/* Treasure dive. Computer: the controls beside the sea. Phone: the sea on top, the controls in a dock under it */
#game:has(.dv){background:radial-gradient(ellipse at 60% 0,rgba(64,190,220,.16),transparent 55%),linear-gradient(#1b0b12,#0a0408)}
.dv{display:grid;grid-template-columns:270px minmax(0,1fr);gap:16px;width:100%;max-width:980px;margin:0 auto;height:clamp(420px,calc(100dvh - 186px),660px);user-select:none}
.dv-side{display:flex;flex-direction:column;gap:9px;min-height:0;padding:14px;border-radius:18px;background:linear-gradient(#1d1218,#0b070a);border:1px solid #e8b42266;box-shadow:inset 0 0 26px #000,0 8px 24px #000a}
.dv-title{font-family:var(--display);font-size:28px;text-align:center;color:#f6d36a;text-shadow:0 0 18px #e8b42299}
.dv-setup,.dv-play{display:flex;flex-direction:column;gap:8px}
.dv:not([data-ph=playing]) .dv-play,.dv[data-ph=playing] .dv-setup{display:none}
.dv-setup label{font-size:13px;opacity:.85}
.dv-levels{display:flex;gap:6px}
.dv-levels button{flex:1;min-width:0;padding:6px 2px;font-weight:700;font-size:14px;line-height:1.25}
.dv-levels small{display:block;font-weight:400;font-size:11px;opacity:.75}
.dv-levels small i{display:none;font-style:normal}.dv-levels small span{display:block;white-space:nowrap}
.dv-levels button.on{border-color:var(--gold);color:var(--gold);box-shadow:inset 0 0 12px #e8b42266}
.dv-levels button.on:disabled{opacity:1}
body:not(.phone) .dv .bb .bb-quick{flex-wrap:wrap}
body:not(.phone) .dv .bb .bb-quick button{flex:1 0 22%}
body:not(.phone) .dv .bb .bb-quick .bb-x{display:block}
.dv-last{list-style:none;margin:6px 0 0;padding:0;font-size:12px}
.dv-last li{display:flex;justify-content:space-between;gap:8px;padding:4px 2px;border-top:1px solid #ffffff1c;opacity:.85}
.dv-last b{direction:ltr}.dv-last b.win,.dv #dv-balloon .win{color:#7CFC8A}.dv-last b.lose,.dv #dv-balloon .lose{color:#ff8a80}
.dv-big{font-family:var(--display);font-size:20px;padding:11px 6px}
.dv .dv-up{line-height:1.1}
.dv .dv-up small{display:block;font-family:var(--body,inherit);font-size:12px;font-weight:700;opacity:.85}
.dv .dv-up:not(:disabled){background:linear-gradient(#5ee08a,#1d8a47);color:#04210f;animation:dvpulse 1.4s infinite}
@keyframes dvpulse{50%{box-shadow:0 0 22px #5ee08a}}
.dv-two{display:flex;flex-direction:column;gap:7px}
#dv-balloon{font-size:13px;border-color:#e9567a}
.dv-odds{display:flex;gap:6px}
.dv-odds div{flex:1;text-align:center;font-size:12px;padding:3px;border-radius:12px;background:#000a;border:1px solid #e8b42233}
.dv-odds b{display:block;font-size:19px;direction:ltr}
.dv-lim{margin-top:auto;font-size:12px;opacity:.7;text-align:center}
.dv-stage{display:flex;flex-direction:column;gap:8px;min-width:0;min-height:0}
.dv-info{display:flex;gap:7px;justify-content:center;align-items:center}
.dv-info div{flex:0 1 140px;min-width:0;text-align:center;padding:2px 6px;border-radius:14px;background:#000a;border:1px solid #e8b42255}
.dv-info span{display:block;font-size:11px;opacity:.75}.dv-info b{font-size:20px;color:var(--gold)}
.dv .dv-info .dv-round{flex:none;width:34px;height:34px;min-width:0;padding:0;border-radius:50%;background:#000a;color:var(--gold);border:1px solid #e8b422aa}
.dv-sea{position:relative;flex:1;min-height:0;overflow:hidden;margin:2px;border-radius:20px;border:5px solid #2b2b33;box-shadow:0 0 0 2px #e8b422aa,0 10px 26px #000c;background:#062a47}
.dv-water{position:absolute;inset:0;width:100%;height:100%;display:block}
.dv-oxy{position:absolute;top:34px;right:8px;width:22px;height:calc(100% - 48px);display:block}
.dv-oxl{position:absolute;right:3px;top:7px;padding:2px 6px;border-radius:12px;background:#000b;border:1px solid #e8b42255;font-size:11px;font-weight:700;color:#fff}
.dv .dv-depth{position:absolute;left:8px;top:8px;padding:3px 12px;border-radius:20px;background:#000a;border:1px solid #e8b42255;font-weight:700;color:var(--gold)}
/* the next depths and what each is worth */
.dv-ladder{position:absolute;left:8px;top:42px;margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:3px;pointer-events:none}
.dv-ladder li{display:flex;justify-content:space-between;gap:8px;min-width:104px;padding:1px 9px;border-radius:12px;background:#000000a6;font-size:11.5px;color:#fff}
.dv-ladder li b{direction:ltr;color:var(--gold)}.dv-ladder li+li{opacity:.75}.dv-ladder li+li+li{opacity:.55}
.dv-ladder li.new{border:1px solid #ffd65acc}
.dv-toast{position:absolute;left:50%;top:22%;transform:translate(-50%,0) scale(.6);opacity:0;pointer-events:none;width:max-content;max-width:calc(100% - 44px);text-align:center;padding:7px 16px;border-radius:14px;background:var(--goldtxt);color:#2a1700;font-family:var(--display);font-size:18px;transition:.25s}
.dv-toast.on{opacity:1;transform:translate(-50%,0) scale(1)}
.dv-end{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);width:min(330px,calc(100% - 56px));padding:8px 12px 10px;text-align:center;border-radius:18px;background:linear-gradient(#2a0a12e6,#14050ae6);border:2px solid var(--gold2)}
.dv-end h2{margin:0;font-family:var(--display);font-weight:400;font-size:19px;line-height:1.15;color:var(--gold)}
.dv-end p{margin:2px 0 6px;font-size:14px}.dv-end button{width:100%;padding:6px;font-family:var(--display);font-size:17px}
.dv-msg{flex:none;min-height:22px;text-align:center;font-family:var(--display);font-size:16px;color:#fff3b0}
.dv-fly{position:fixed;left:0;top:0;pointer-events:none;z-index:60}
.dv-jr ul{list-style:none;margin:0;padding:0}.gh-box.dv-jr li{padding:8px 4px;border-bottom:1px solid #ffffff22;margin:0}
.dv-jh{display:flex;justify-content:space-between;gap:8px}.dv-jh b.win{color:#7CFC8A}.dv-jh b.lose{color:#ff8a80}.dv-jh b.n{direction:ltr}.dv-jb{font-size:12px;opacity:.65;margin-top:3px}
/* a new badge stays small and off the controls */
body:not(.phone):not(.home-on):has(.dv) #sc-pop{max-width:172px}
body:has(.dv) #sc-pop .badge-note .sc-bt div div:not(.win){display:none}
body:not(.phone):has(.dv) #sc-pop .badge-note{padding:8px}
body:not(.phone):has(.dv) #sc-pop .badge-note svg{width:34px;height:34px}
body.phone.ingame:has(.dv) #sc-pop{top:calc(env(safe-area-inset-top) + 118px);left:52px;right:52px}
body.phone:has(.dv) #sc-pop .badge-note{padding:4px 10px;font-size:12px}
body.phone:has(.dv) #sc-pop .badge-note svg{width:32px;height:32px}
@media(max-height:730px){body:not(.phone) .dv{height:max(360px,calc(100dvh - 180px));gap:12px}body:not(.phone) .dv-side{gap:6px;padding:9px}body:not(.phone) .dv-title{font-size:21px}body:not(.phone) .dv-big{font-size:17px;padding:7px}body:not(.phone) .dv-lim,body:not(.phone) .dv-last,body:not(.phone) .dv-setup label{display:none}}

body.phone.ingame #game:has(.dv){padding:0}
body.phone .dv{display:flex;flex-direction:column;gap:0;flex:1;min-height:0;height:auto;max-width:100%}
body.phone .dv-stage{order:1;flex:1;padding:7px 6px 4px;gap:6px}
/* both docks lie in one cell, so the sea keeps its height when a dive starts or ends */
body.phone .dv-side{order:2;flex:none;display:grid;grid-template-columns:minmax(0,1fr);padding:8px 10px calc(env(safe-area-inset-bottom) + 8px);border-radius:0;border:0;border-top:2px solid var(--gold2);box-shadow:none}
body.phone .dv-setup,body.phone .dv-play{grid-area:1/1;display:flex;justify-content:space-between;gap:6px}
body.phone .dv:not([data-ph=playing]) .dv-play,body.phone .dv[data-ph=playing] .dv-setup{display:flex;visibility:hidden}
body.phone .dv-title,body.phone .dv-lim,body.phone .dv-setup label,body.phone .dv-last{display:none}
body.phone .dv-odds{flex:1}
body.phone .dv-odds div{display:flex;flex-direction:column;justify-content:center}
body.phone .dv-two{flex-direction:row}body.phone .dv-two button{flex:1;min-width:0;height:52px;padding:0;font-size:17px}
body.phone .dv-two .dv-up{flex:1.25}
body.phone #dv-start{height:44px;padding:0}
body.phone #dv-balloon{min-height:36px}
body.phone .dv-info b{font-size:17px}
body.phone .dv-msg{font-size:14px;min-height:19px}
@media(max-height:680px){
  body.phone .dv-stage{position:relative}
  /* no room under the sea: the message lies on it */
  body.phone .dv-msg{position:absolute;left:14px;right:44px;bottom:12px;min-height:0;font-size:12.5px;pointer-events:none;text-shadow:0 0 4px #000,0 1px 3px #000}
  body.phone .dv:has(.dv-end:not([hidden])) .dv-msg{display:none}
  body.phone .dv-levels button{padding:3px 1px;font-size:13px}
  body.phone .dv-levels small{font-size:10px;white-space:nowrap}
  body.phone .dv-levels small i{display:inline}body.phone .dv-levels small span{display:inline;font-size:0}
  body.phone .dv-levels small span::after{content:attr(data-r);font-size:10px}
  /* the hidden dock goes at once: a fading button would show through the other one */
  body.phone .dv-side button{transition-property:transform,filter,box-shadow}
  body.phone .dv-two button{height:40px;font-size:15px}
  body.phone .dv .dv-up small{font-size:10px}
  body.phone #dv-start{height:38px}
  body.phone .dv-odds b{font-size:16px}
  body.phone .dv-odds div{font-size:11px;padding:1px}
  body.phone #dv-balloon{min-height:34px}
  body.phone .dv-ladder li+li+li{display:none}
  body.phone .dv-end{bottom:6px;padding:5px 10px 7px}
  body.phone .dv-end h2{font-size:15px}
  body.phone .dv-end p{font-size:12px;margin:0 0 4px}
  body.phone .dv-end button{padding:3px;font-size:15px}
}
@media(prefers-reduced-motion:reduce){.dv .dv-up:not(:disabled){animation:none}.dv-toast{transition:none}}
.hm-dive{--c1:#0e5f8c;--c2:#04121f}
.ml .t-dive{background:linear-gradient(160deg,#1179a8,#04121f)}
