.in-room.fishing {display:flex;flex-direction:column;height:100vh;height:100dvh}
.in-room.fishing main {display:flex;flex-flow:column;flex:1;min-height:0;width:100%;max-width:min(560px,max(320px,75dvh));margin:0 auto;padding:0}
.in-room.fishing #room {display:flex;flex-flow:column;flex:1;min-height:0;margin:0;padding:0;max-width:none}
.fishing #machine {display:none}
#reef {
  display:flex;flex-flow:column;flex:1;min-height:0;color:#ffefd4;isolation:isolate;background:#082136;
  --brass:#cf9e59;--brass-edge:#735136;--navy:#0a2030;--aqua:#a8e4e2;
  font-family:system-ui,"Microsoft YaHei",sans-serif;
}
.reef-water {position:relative;flex:1;min-height:130px;overflow:hidden;background:linear-gradient(180deg,#041a375c,transparent 25% 78%,#03152480),var(--scene) center/cover no-repeat}
.reef-water::before {content:"";position:absolute;inset:-12%;pointer-events:none;background:repeating-linear-gradient(111deg,transparent 0 10%,#b3fff80c 11%,transparent 15% 22%);animation:reef-light 13s ease-in-out infinite alternate}
@keyframes reef-light {to{transform:translate(5%,2%) rotate(3deg);opacity:.48}}
#reefCanvas {display:block;position:absolute;inset:0;width:100%;height:100%;touch-action:manipulation;cursor:crosshair}
.reef-hud {position:absolute;top:max(12px,env(safe-area-inset-top));left:64px;right:max(12px,env(safe-area-inset-right));display:flex;align-items:center;justify-content:space-between;gap:7px;pointer-events:none}
.reef-place,.reef-hud button,.in-room.fishing #gameBackSlot #roomBack {
  border:1px solid #c39a60;border-radius:10px;color:#f9dfb0;
  background:linear-gradient(155deg,#294956ed,#071a2dfa 75%);box-shadow:inset 0 0 0 2px #10283b,0 2px 5px #00152666;
}
.reef-place,.reef-hud button {display:inline-flex;align-items:center;gap:7px;padding:0 10px;min-height:38px;font-size:12px;white-space:nowrap}
.reef-place {border-radius:3px 12px 3px 12px;font-weight:800;letter-spacing:.04em}
.reef-hud button {min-height:44px;pointer-events:auto}.reef-hud svg {flex:none}
.reef-boss {position:absolute;top:calc(max(12px,env(safe-area-inset-top)) + 53px);left:12px;display:grid;grid-template-columns:40px auto auto;align-items:center;gap:7px;min-height:48px;padding:3px 9px 3px 3px;text-align:left;line-height:1.2;
  background:linear-gradient(110deg,#30273aef,#17293bf2 52%,#142333e0);border:1px solid #b09063;border-radius:24px 6px 6px 24px;color:#fff0ce}
#reefBossPortrait {display:grid;place-content:center;width:40px;height:40px;overflow:hidden;border-radius:50%;border:2px solid #ddbd83;background:radial-gradient(circle at 40% 30%,#517b84,#172638);box-shadow:0 0 0 1px #342b29}
#reefBossPortrait canvas {width:43px;height:28px;object-fit:contain}
.reef-boss small,.reef-boss strong {display:block}.reef-boss small {font-size:9px;color:#f2ce92;letter-spacing:.1em}.reef-boss strong{font-size:13px;margin-top:2px}
.reef-boss em {border-left:1px solid #d8b98259;padding-left:7px;font:650 11px system-ui;color:#f3dfb8}
.reef-target,.reef-crew {position:absolute;bottom:9px;pointer-events:none;font-size:10px}
.reef-target {left:max(9px,env(safe-area-inset-left));display:flex;align-items:center;gap:4px;padding:4px 7px;color:#f0e4bc;background:#071d2cd9;border-radius:5px;border-left:2px solid #cfa770}
.reef-target svg {color:#8addd4}.reef-target span,.reef-target small{font-size:10px;color:#b3c7cd}.reef-target b{font-size:11px}
.reef-crew {right:max(9px,env(safe-area-inset-right));display:grid;justify-items:end;gap:3px;color:#d5e9eb;text-shadow:0 1px 3px #06111c}
.reef-crew>span:not([hidden]) {background:#071d2cd9;padding:1px 5px;border-radius:4px}
.reef-crew .reef-chest {display:flex;align-items:center;gap:4px;border:1px solid #b49356;color:#ffe0a0;font-weight:750}
.reef-chest img {width:20px;height:18px;object-fit:contain}
.reef-deck {
  position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:clamp(8px,3vw,16px);
  padding:10px max(14px,env(safe-area-inset-right)) 8px max(14px,env(safe-area-inset-left));
  border-top:3px solid #bc965c;box-shadow:0 -3px 0 #2d3530,inset 0 1px 0 #ebce8c88;
  background:radial-gradient(circle at 5px 6px,#bba47d 1px,#483e34 2px,transparent 3px),
             radial-gradient(circle at calc(100% - 5px) 6px,#bba47d 1px,#483e34 2px,transparent 3px),
             repeating-linear-gradient(100deg,#ffffff03 0 1px,transparent 2px 5px),linear-gradient(175deg,#27434b,#102737 42%,#0a1b29);
}
.reef-panel {display:flex;flex-direction:column;min-width:0;gap:5px}
.reef-modes {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
.reef-modes button {position:relative;display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:44px;padding:2px 4px;line-height:1.1;font:650 11px system-ui;color:#c6d7d5;
  border:1px solid #64736d;border-bottom-color:#3a4a50;border-radius:5px;background:linear-gradient(#2e454b,#172f3b 48%,#182e37 52%,#142934);box-shadow:inset 0 1px #a5bcb633,0 2px 0 #071723}
.reef-modes button svg {color:#91c8c8;flex:none}.reef-modes button span {white-space:nowrap}
.reef-modes button[aria-pressed=true] {color:#fff2ca;border-color:#f0c179;background:linear-gradient(#68532e,#413928);box-shadow:inset 0 0 8px #f1bd7540}
.reef-modes button[aria-pressed=true] svg {color:#ffd181}
.reef-receipt {display:flex;align-items:center;justify-content:space-between;gap:3px;color:#adc4c7;font-size:10px;line-height:1.25;min-height:15px;font-variant-numeric:tabular-nums}
.reef-receipt span:first-child {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reef-receipt span:last-child {white-space:nowrap}
.reef-receipt b {color:#ffd791;font-size:11px}
.reef-controls {min-width:0}.reef-level {display:grid;grid-template-columns:44px 1fr 44px;align-items:stretch;padding:2px;
  background:linear-gradient(#091922,#112834);border:1px solid #927959;border-radius:7px;box-shadow:inset 0 1px 4px #010b14}
.reef-level button {min-width:0;min-height:44px;padding:0;color:#f4d397;background:transparent;border:0;display:grid;place-content:center;border-radius:4px}
.reef-level button:not(.reef-stake) {background:linear-gradient(155deg,#39484b,#20303a 60%);border:1px solid #68716b}
.reef-level button:disabled {opacity:.42}.reef-stake {text-align:center;line-height:1}
.reef-stake small {color:#a5c1c4;font-size:10px}.reef-stake strong {color:#ffefca;font:750 20px/1.12 system-ui;font-variant-numeric:tabular-nums}
.reef-fire {display:grid;place-content:center;justify-items:center;gap:2px;width:clamp(68px,20vw,92px);aspect-ratio:1;padding:0;border-radius:50%;
  border:3px solid #e8bd76;color:#fff2cd;text-shadow:0 1px 2px #67240e;
  background:radial-gradient(ellipse at 46% 24%,#f7a459,#cc5b32 43%,#933b26 72%,#652c21 95%);
  box-shadow:0 0 0 2px #624e3f,0 0 0 4px #b59b74,0 5px 0 4px #0a1822,inset 0 0 0 2px #943f26,inset 0 0 0 3px #ffdb978c;
  font:800 16px/1 system-ui}
.reef-fire svg {width:24px;height:24px}.reef-fire:disabled {filter:saturate(.5);opacity:.72}
.reef-deck button:active:not(:disabled){transform:translateY(1px)}.reef-deck button:focus-visible,.reef-boss:focus-visible{outline:2px solid #ffe6a8;outline-offset:2px}
.in-room.fishing #gameFooter {background:#091b29;border-top:1px solid #68706966}
.fishing #problem {position:fixed;z-index:4;bottom:110px;left:50%;transform:translateX(-50%);width:min(90%,410px)}
.reef-fish-guide {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}
.reef-fish-guide div {border:1px solid var(--line);border-radius:12px;padding:9px;display:grid;gap:3px}.reef-fish-guide small{color:var(--muted)}.reef-fish-guide canvas{width:72px;height:42px;max-width:100%;display:block}
@media(max-width:370px){.reef-modes button{gap:3px;font-size:10px}.reef-modes button svg{width:12px}.reef-deck{padding-inline:10px;gap:9px}.reef-place,.reef-hud button{gap:4px;padding-inline:7px}}
@media(prefers-reduced-motion:reduce){.reef-water::before,.reef-island img{animation:none}}
#reefRooms{
  position:relative;isolation:isolate;display:flex;flex:1;min-height:0;flex-direction:column;
  align-items:center;overflow:auto;background:#06336d url('/art/fish-master/lobby.webp') center/cover;
  padding:max(12px,env(safe-area-inset-top)) 12px 10px;
}
#reefRooms::before{content:"";position:absolute;z-index:-1;inset:0;pointer-events:none;background:radial-gradient(ellipse at 58% 14%,#50eaff37,transparent 53%),radial-gradient(ellipse at 18% 85%,#7357e937,transparent 48%)}
.reef-title{display:block;flex:none;width:auto;max-width:52%;height:clamp(62px,13dvh,114px);object-fit:contain;filter:drop-shadow(0 5px 10px #051a5080)}
.reef-islands{flex:1;width:100%;max-width:440px;min-height:285px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));align-items:stretch}
.reef-island,.reef-island:hover,.reef-island:active{position:relative;display:grid;place-items:center;width:100%;min-width:0;min-height:0;background:transparent;border:0;box-shadow:none;padding:0;touch-action:manipulation}
.reef-island img{max-width:96%;width:100%;height:100%;min-height:0;object-fit:contain;filter:drop-shadow(0 7px 6px #011e5280);animation:reef-float 4.2s ease-in-out infinite alternate;pointer-events:none}
.reef-island:nth-child(even){top:5%}.reef-island:nth-child(even) img{animation-delay:-2.3s}
.reef-island:nth-child(3) img{animation-delay:-1.2s}.reef-island:nth-child(4) img{animation-delay:-3s}
.reef-island.coming{grid-column:1/-1;width:53%;justify-self:center}
.reef-island:focus-visible{outline:2px solid #9cf5ff;border-radius:18px}
.reef-island:active img{filter:drop-shadow(0 0 8px #c3ffff);scale:.96}
@keyframes reef-float{from{transform:translateY(2px) rotate(-.7deg)}to{transform:translateY(-3px) rotate(.6deg)}}

@media(prefers-reduced-motion:reduce){.reef-island img{animation:none}}
