.chests {	
    background: rgba(0, 0, 0, 0) url(../images/chaotic.png) no-repeat top center;
	width:100%;
}

.chests fieldset {
    color: #706352;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
    display: block;
    border: 1px solid rgba(0, 0, 0, .35);
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    padding: 3px;
    box-shadow: inset 0 1px 0 rgba(194, 181, 132, .05), inset 0 0 3px rgba(255, 255, 255, .02), 0 0 10px rgba(0, 0, 0, .25);
    background-image: url(../images/store_item_hover.png);
    position: relative;
    width: 430px;
    text-align: left;
    margin-left: 50px;

}
.chests legend {
    color: #a48f4f;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
    display: block;
    background: rgb(26, 25, 24,0.8);
    border: 1px solid rgba(0, 0, 0, .35);
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(194, 181, 132, .05), inset 0 0 3px rgba(255, 255, 255, .02), 0 0 10px rgba(0, 0, 0, .25);
    min-width: 100px;
    padding: 5px;
	margin-left:10px;
	margin-bottom:0px;
    z-index: 99;
}

#chestform img {
	cursor:pointer;
	padding: 3px;
	margin: 2px;	
	float:left;
	border: 3px solid rgba(0, 0, 0, 0.1);
 }
 
#chestform img:hover {	
	border: 3px solid rgb(151, 121, 59); 
}

#chestform .selected_item {	
	border: 3px solid rgb(151, 121, 59) !important;
}

.chest-empty-groups {
    padding: 22px 16px;
    color: #aeb6c3;
    border: 1px solid rgba(226, 177, 67, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    text-align: center;
}


#chest-container {
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
	margin-left:15px;
    width: 530px;
    max-height: 520px;
    clear: both;
    background: rgba(0, 0, 0, .5);
    border-radius: 4px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .05);
    overflow: hidden;
	color: #706352;
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
    display: block;
    border: 1px solid rgba(0, 0, 0, .35);
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
	box-shadow: inset 0 1px 0 rgba(194, 181, 132, .05), inset 0 0 3px rgba(255, 255, 255, .02), 0 0 10px rgba(0, 0, 0, .25);
    background-image: url(../images/store_item_hover.png);
	
	
}
#chest-container .viewport {
    width: 520px;
    min-height: 0;
    height: 500px;
    overflow: hidden;
    position: relative;
    float: left
}
#chest-container .overview {
    position: absolute;
    left: 0;
    top: 0;
    text-align: left;
    padding: 5px;
    color: #6c6c6c
}
.chest-shadow {
    width: 700px;
    height: 34px;
    --background: url(../images/chest-shadow.html) repeat-x;
    position: absolute;
    bottom: 0px;
    left: 0;
    z-index: 1
}
#chest-container .scrollbar {
    position: relative;
    float: right;
    width: 10px;
    left: -2px;
    z-index: 2
}
#chest-container .track {
    background: rgba(0, 0, 0, .4);
    height: 100%;
    width: 10px;
    position: relative;
    padding: 0 1px
}
#chest-container .thumb {
    background: #191816;
    width: 8px;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: inset 0 2px 0 #0a0908, inset 0 -2px 0 #0a0908
}


#chest_details {
    color: rgba(229, 204, 128, 0.51);
    padding: 12px;
    margin: 0;
}


#chest_details .p_left {   	
	width:50px;
	display: table-cell;
    vertical-align: middle;
}


#chest_details .p_right {	
   display: table-cell;
   width:120px;
   margin-left:50px;
   padding:10px;
   vertical-align: middle;   
}
#chest_details li img {
	margin-left:5px;
	margin-top:6px;
    width: 45px;
    height: 45px;
    object-fit: cover;
}

#chest_details li { 	
	width:236px;	
	margin-top:5px;
	margin-left:4px;
	display: inline-block;
	text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
	border: 1px solid rgba(0, 0, 0, .35);
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
	padding: 3px;
	box-shadow: inset 0 1px 0 rgba(194, 181, 132, .05), inset 0 0 3px rgba(255, 255, 255, .02), 0 0 10px rgba(0, 0, 0, .25);
	background-image: url(../images/store_item_hover.png);   
	margin-bottom:2px;
}

#chest_details .chest-selected-item {
    display: flex;
    align-items: center;
    width: 488px;
    min-height: 74px;
    margin-bottom: 10px;
    border-color: rgba(226, 177, 67, .42);
    background: linear-gradient(135deg, rgba(226, 177, 67, .14), rgba(15, 18, 24, .9)), url(../images/store_item_hover.png);
}

#chest_details .chest-selected-item .p_left {
    display: block;
    width: 64px;
}

#chest_details .chest-selected-item .p_right {
    display: block;
    width: 390px;
    padding: 8px 10px;
}

#chest_details .chest-selected-item .p_right span {
    display: block;
    margin-bottom: 4px;
    color: #e2b143;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#chest_details .chest-selected-item .p_right h1 {
    width: 100%;
    color: #f2f0e9;
    font-size: 15px;
}

#chest_details .chest-selected-item .p_right p {
    color: #aeb6c3;
}

#chest_details .chest-empty {
    width: 488px;
    padding: 18px;
    color: #aeb6c3;
    text-align: center;
}

#chest_details .p_right h1 {
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
	width:155px;
}

#chest_details .p_right p {
    font-family: 'Merriweather Sans', sans-serif;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#chestdiv {
	margin-top:21px;
}

#chestdiv .chestloading {
	width:430px;
	height:400px;	
	text-align: center;
	vertical-align: middle;
	line-height: 420px;
}

.chests table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 24px 0;
}

.chests td {
    width: 50%;
    vertical-align: top;
}

#chestform {
    width: min(430px, 100%);
    margin: 110px auto 0;
}

.chests fieldset {
    width: 100%;
    margin-left: 0;
}

#chestdiv {
    margin-top: 76px;
}

#chest-container {
    width: min(500px, 100%);
    margin-left: auto;
    margin-right: auto;
}

#chest-container .viewport {
    width: 100%;
}

#chest-container .overview {
    width: 100%;
}

#chest_details li {
    width: calc(50% - 10px);
    min-height: 76px;
    vertical-align: top;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_left {
    display: block;
    flex: 0 0 54px;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right {
    display: block;
    width: calc(100% - 62px);
    padding: 6px 4px;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right h1 {
    width: 100%;
}

#chestdiv #chest_details .chest-selected-item {
    display: flex !important;
    width: calc(100% - 8px) !important;
}

#chestdiv #chest_details .chest-selected-item .p_right {
    width: calc(100% - 74px);
}

#chestdiv #chest_details .chest-empty {
    width: calc(100% - 8px);
}

#chestdiv #chest-container {
    /* Sonuçlar sayfayı uzatmasın; kaydırma yalnızca sağ panel içinde olsun. */
    height: 520px !important;
    max-height: 520px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: #8f6a22 rgba(0, 0, 0, .45);
}

#chestdiv #chest-container .viewport {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    float: none;
    width: 100% !important;
}

#chestdiv #chest-container .overview {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    top: auto !important;
    padding: 0;
}

#chestdiv #chest-container .scrollbar,
#chestdiv #chest-container .chest-shadow {
    display: none !important;
}

#chestdiv #chest-container::-webkit-scrollbar {
    width: 10px;
}

#chestdiv #chest-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, .45);
    border-radius: 6px;
}

#chestdiv #chest-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d7aa3d, #765317);
    border: 2px solid rgba(15, 18, 24, .85);
    border-radius: 6px;
}

/* ValuableItems sonuç kartları: dar ekranlarda metin ve ikonlar taşmasın. */
#chestdiv #chest_details {
    box-sizing: border-box;
    padding: 10px 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) {
    box-sizing: border-box;
    width: auto !important;
    min-height: 70px;
    margin: 0;
    padding: 6px;
    display: flex !important;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    vertical-align: top;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_left {
    width: 38px !important;
    flex: 0 0 38px;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_left img {
    width: 36px;
    height: 36px;
    margin: 0;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right {
    box-sizing: border-box;
    min-width: 0;
    width: auto !important;
    flex: 1 1 auto;
    margin-left: 0 !important;
    padding: 0;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right h1,
#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right p {
    width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right h1 {
    font-size: 11px;
}

#chestdiv #chest_details li:not(.chest-selected-item):not(.chest-empty) .p_right p {
    font-size: 10px;
}

#chestdiv #chest_details .chest-selected-item,
#chestdiv #chest_details .chest-empty {
    grid-column: 1 / -1;
    width: auto !important;
    margin: 0;
}
