.treasure-art-column:has(.island-treasure-entry) > .treasure-art {
 transform:translateY(-13px);
}
.treasure-art-column .island-treasure-entry {
 position:relative;
 transform:translateY(-3px);
 box-sizing:border-box;
 display:flex;
 flex-direction:column;
 align-items:center;
 justify-content:flex-start;
 gap:0;
 min-width:0;
 width:min(100%,76px);
 height:clamp(30.53px,calc(8.1333vw + 7.8667px),46.53px);
 justify-self:center;
 padding:2px 3px 4px;
 border:2px solid #f6cb76;
 border-radius:9px;
 background:linear-gradient(180deg,#f6d98a 0%,#d6a64f 55%,#9b6a1f 100%);
 box-shadow:inset 0 0 0 1px #ffe7a8,0 2px 4px #502d1659,0 0 7px 2px #ffe79e99;
 filter:brightness(1.09);
 color:#48280f;
 font:700 12px/1.15 var(--chrome-font, Georgia, serif);
 text-shadow:0 1px 1px #ffebac;
}
.treasure-art-column .island-treasure-entry img {
 max-height:100%;
 transform:translateY(-5px);
}
.treasure-art-column .island-treasure-entry strong {
 position:absolute;
 inset-inline:0;
 bottom:2px;
 text-align:center;
 color:#fff4d6;
 text-shadow:0 1px 2px #4b290f;
}
.island-treasure-entry img {
 display:block;
 width:clamp(34px,12.2vw,58px);
 height:clamp(34px,12.2vw,58px);
 object-fit:contain;
}
.treasure-art-column .island-treasure-entry:hover,
.treasure-art-column .island-treasure-entry:active {
 filter:brightness(1.09);
 box-shadow:inset 0 0 0 1px #ffe7a8,0 2px 4px #502d1659;
}
.treasure-art-column .island-treasure-entry:focus-visible {
 outline:2px solid #986025;
 outline-offset:2px;
}

.island-treasure-screen {
 --treasure-gold:#e5b55f;
 --treasure-light:#fff0c6;
 --treasure-coast:#163b3d;
 --treasure-font:var(--chrome-font, Georgia, 'Times New Roman', serif);
 box-sizing:border-box;
 position:fixed;
 inset:0;
 width:100%;
 height:100%;
 max-width:none;
 max-height:none;
 margin:0;
 padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
 border:0;
 overflow:hidden;
 background:radial-gradient(ellipse at 50% 34%,#285d55 0%,#132e32 50%,#08151d 93%);
 color:var(--treasure-light);
}
.island-treasure-screen[open] {
 display:grid;
 grid-template-rows:auto minmax(0,1fr) auto;
 place-items:center;
 gap:clamp(5px,1.3vh,16px);
}
.island-treasure-screen::before {
 position:absolute;
 inset:0;
 content:'';
 pointer-events:none;
 background:url('../img/ui/wood.webp') repeat;
 opacity:.24;
}
.treasure-header,.treasure-footer {
 position:relative;
 width:min(100%,760px);
}
.treasure-header {
 display:grid;
 grid-template-columns:auto minmax(0,1fr) auto auto;
 align-items:center;
 gap:clamp(5px,2vw,20px);
 padding:5px clamp(6px,1.8vw,15px);
 border:2px ridge var(--treasure-gold);
 border-radius:13px;
 background:linear-gradient(180deg,#296071,#154452 47%,#102b38);
 box-shadow:inset 0 0 0 2px #4e3221,inset 0 0 0 3px #dca35b48,0 5px 16px #020f16a6;
}
.treasure-crest {
 width:clamp(34px,11vw,61px);
 height:clamp(34px,11vw,61px);
 object-fit:contain;
 filter:drop-shadow(0 3px 4px #010f15a0);
}
.treasure-heading {
 min-width:0;
}
.treasure-heading h2 {
 margin:0;
 color:var(--treasure-light);
 font:700 clamp(20px,5.6vw,32px)/1.01 var(--treasure-font);
 text-shadow:0 2px 2px #071719;
}
.treasure-heading .treasure-island {
 overflow:hidden;
 margin:4px 0 0;
 color:#f5d493;
 font:600 clamp(10px,2.7vw,13px)/1.15 var(--treasure-font);
 text-overflow:ellipsis;
 white-space:nowrap;
}
.treasure-counter {
 display:grid;
 place-items:center;
 gap:1px;
 min-width:59px;
 padding:4px 6px;
 color:#f4d18c;
 background:#102a31;
 border:1px solid #b68243;
 border-radius:7px;
 box-shadow:inset 0 1px 5px #030e14a0,0 1px #dcb27140;
 font:700 clamp(8px,2vw,11px)/1.07 var(--treasure-font);
 white-space:nowrap;
}
.treasure-counter strong {
 color:#fff0c6;
 font-size:clamp(14px,4vw,20px);
 font-variant-numeric:tabular-nums;
}
.treasure-dismiss {
 display:grid;
 place-items:center;
 width:clamp(36px,9vw,44px);
 aspect-ratio:1;
 padding:0;
 border:2px ridge #e4b265;
 border-radius:9px;
 color:#ffdf9a;
 background:linear-gradient(#693b1c,#2c1a12);
 box-shadow:0 2px 5px #010d14aa,inset 0 0 0 2px #20150f80;
 font:700 clamp(23px,6vw,29px)/1 var(--treasure-font);
 text-shadow:0 2px #2b150a;
}
.treasure-field {
 position:relative;
 display:grid;
 place-items:center;
 width:100%;
 min-height:0;
 height:100%;
 container-type:size;
}
.treasure-frame {
 position:relative;
 display:grid;
 width:min(94vw,calc(100vh - 120px),740px);
 width:min(100cqw,100cqh,740px);
 aspect-ratio:1;
 min-width:0;
 padding:clamp(4px,1vw,8px);
 border:2px ridge #f4c778;
 border-radius:clamp(7px,2vw,16px);
 background:linear-gradient(145deg,#ad7543,#462a1c 30%,#653d25 75%,#9d673b);
 box-shadow:0 6px 24px #020e15aa,inset 0 0 0 2px #2d211b,inset 0 0 0 3px #edba6d7f;
}
.treasure-board {
 position:relative;
 display:grid;
 grid-template-rows:repeat(20,minmax(0,1fr));
 min-height:0;
 overflow:hidden;
 border:1px solid #edd698;
 border-radius:clamp(3px,.7vw,9px);
 background:#183d39;
 touch-action:manipulation;
}
.treasure-row {
 display:grid;
 grid-template-columns:repeat(20,minmax(0,1fr));
 min-height:0;
}
.treasure-row > div {
 min-width:0;
 min-height:0;
}
.treasure-cell {
 --treasure-cover:1;
 position:relative;
 display:grid;
 place-items:center;
 width:100%;
 height:100%;
 isolation:isolate;
 padding:0;
 border:0;
 border-radius:0;
 background:radial-gradient(ellipse at 50% 42%,#9c7242,#5b371a 78%,#392519);
 color:#fff7d9;
 font:700 clamp(8px,1.15cqw,13px)/1 Arial,sans-serif;
 font-variant-numeric:tabular-nums;
 cursor:url('../img/treasure/shovel.png') 4 28,crosshair;
}
.treasure-cell::before {
 position:absolute;
 inset:0;
 z-index:-1;
 content:'';
 pointer-events:none;
 background-image:url('../img/treasure/island.webp');
 background-size:2000% 2000%;
 background-position:var(--treasure-x) var(--treasure-y);
 opacity:var(--treasure-cover);
 transition:opacity .16s ease-out;
}
.treasure-cell::after {
 position:absolute;
 inset:0;
 z-index:1;
 content:'';
 pointer-events:none;
 border-right:1px solid #211d1a70;
 border-bottom:1px solid #211d1a70;
}
.treasure-cell:hover:not(:disabled), .treasure-cell:focus-visible {
 z-index:1;
 outline:0;
 box-shadow:0 0 5px #ebbb54bb;
 filter:none;
}
.treasure-cell:hover::after, .treasure-cell:focus-visible::after {
 border:1.5px solid #ffe4a0;
}
.treasure-cell.is-excavating {
 z-index:2;
}
.treasure-cell:is(.is-hole,.has-chest) {
 background:radial-gradient(ellipse 42% 34% at 50% 55%,#19120c 52%,#321a0f 69%,#7a4f29 77%,#ae8045 94%,transparent 100%),linear-gradient(145deg,#936938,#53351e);
}
.treasure-cell.has-chest {
 background:radial-gradient(ellipse at 50% 42%,#dfb15d,#794925 63%,#392519);
}
.treasure-cell.is-hole, .treasure-board.is-locked .treasure-cell {
 cursor:default;
}
.treasure-board.is-cooling:not(.is-locked) .treasure-cell:not(.is-hole) {
 cursor:url('../img/treasure/shovel.png') 4 28,wait;
}
.treasure-percent {
 position:relative;
 z-index:1;
 padding:1px;
 border-radius:3px;
 color:#fff5cb;
 text-shadow:0 1px 2px #160e09,0 0 2px #160e09,-1px 0 #160e09;
 background:#33201571;
 pointer-events:none;
}
.treasure-percent:empty {
 display:none;
}
.treasure-cell-chest {
 position:absolute;
 z-index:1;
 width:100%;
 height:100%;
 object-fit:contain;
 filter:drop-shadow(0 1px 3px #ffe297);
 pointer-events:none;
}
.treasure-loading {
 position:absolute;
 top:50%;
 left:50%;
 width:max-content;
 max-width:90%;
 margin:0;
 padding:10px 16px;
 transform:translate(-50%,-50%);
 border:1px solid #ca9f58;
 border-radius:8px;
 background:#102e36;
 color:#ffedc5;
 font:700 16px/1.25 var(--treasure-font);
 pointer-events:none;
}
.treasure-field:has(.treasure-loading:not([hidden])) .treasure-board {
 filter:brightness(.65);
}
.treasure-reward {
 position:absolute;
 z-index:3;
 left:50%;
 bottom:clamp(8px,5cqh,48px);
 display:flex;
 gap:clamp(6px,2cqw,18px);
 align-items:center;
 width:max-content;
 max-width:min(90%,420px);
 padding:8px clamp(8px,3cqw,20px);
 transform:translateX(-50%);
 border:3px ridge #e6b360;
 border-radius:13px;
 background:linear-gradient(#ffebbfdf,#e4bb81b8),url('../img/ui/parchment.webp') center;
 color:#542f17;
 box-shadow:inset 0 0 0 2px #fff3cc,0 7px 27px #030e17b5;
}
.treasure-reward img {
 width:clamp(40px,17cqw,90px);
 aspect-ratio:1;
 object-fit:contain;
 filter:drop-shadow(0 4px 3px #74371377);
}
.treasure-reward h3 {
 margin:0;
 color:#573519;
 font:700 clamp(15px,4vw,21px)/1.1 var(--treasure-font);
}
.treasure-reward p {
 margin:3px 0 6px;
 font:600 clamp(11px,3vw,15px)/1.13 var(--treasure-font);
}
.treasure-claim.woodbtn {
 min-height:36px;
 padding:5px 15px;
 border-color:#d6a757;
 background:linear-gradient(#416f46,#23482f 60%,#173b29);
 color:#fff0ca;
}
.treasure-footer {
 display:flex;
 flex-wrap:wrap;
 align-items:center;
 justify-content:center;
 gap:clamp(3px,1vh,8px) 11px;
 padding:5px 8px;
 border-top:1px solid #bd8f51;
 background:linear-gradient(#09222955,transparent);
 color:#e4cc9d;
 font:600 clamp(10px,2.8vw,13px)/1.17 var(--treasure-font);
 text-align:center;
}
.treasure-footer p {
 margin:0;
}
.island-treasure-screen .treasure-status:not(:empty) {
 color:#ffe2a1;
}
.treasure-retry.woodbtn {
 min-height:29px;
 padding:2px 8px;
}
.treasure-dirt {
 position:absolute;
 z-index:2;
 top:50%;
 left:50%;
 width:0;
 height:0;
 pointer-events:none;
}
.treasure-dirt i {
 position:absolute;
 width:clamp(3px,.6cqw,5px);
 height:clamp(3px,.6cqw,5px);
 border-radius:31% 66% 40% 42%;
 background:#b9854d;
 box-shadow:inset 0 1px #f6bc77bb,0 1px 2px #2a1b13;
 opacity:0;
 animation:treasure-dirt-flight .50s ease-out forwards;
}
.treasure-dirt--found i {
 background:#ffe78d;
 box-shadow:0 0 5px #ffbd34;
}
.treasure-dirt--empty i {
 background:#58412b;
}
.treasure-dirt--found::before, .treasure-dirt--empty::before {
 position:absolute;
 top:0;
 left:0;
 width:3.3em;
 height:3.3em;
 border:2px solid #ffe397;
 border-radius:50%;
 content:'';
 animation:treasure-dirt-ring .58s ease-out both;
}
.treasure-dirt--empty::before {
 border-color:#bd915c;
}
@keyframes treasure-dirt-flight {
 0% { opacity:1; transform:translate(0,0) scale(.5); }
 43% { opacity:1; transform:translate(calc(var(--treasure-drift) * .55), var(--treasure-rise)) rotate(var(--treasure-turn)); }
 100% { opacity:0; transform:translate(var(--treasure-drift), .5em) rotate(calc(var(--treasure-turn) * 2)) scale(.5); }
}
@keyframes treasure-dirt-ring {
 from { opacity:.9; transform:translate(-50%,-50%) scale(.25); }
 to { opacity:0; transform:translate(-50%,-50%) scale(1.1); }
}
@media (max-height:440px) and (orientation:landscape) {
 .island-treasure-screen[open] { grid-template-columns:minmax(115px,200px) minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:4px 9px; }
 .treasure-header { grid-column:1; grid-row:1; grid-template-columns:auto minmax(0,1fr); }
 .treasure-header .treasure-counter { justify-self:stretch; }
 .treasure-dismiss { justify-self:end; }
 .treasure-field { grid-column:2; grid-row:1 / 3; }
 .treasure-footer { grid-column:1; grid-row:2; }
}
@media (max-width:440px) {
 .treasure-percent { transform:scaleX(.84); }
}
@media (prefers-reduced-motion:reduce) {
 .treasure-cell::before { transition:none; }
 .treasure-dirt { display:none; }
}
