/* Not Battleship on a phone: the turn bar, the ocean (as big as the screen allows), the
   shipyard or the fleet row, and the FIRE button. Dark rules first, light overrides last. */
.nbp { display: flex; flex-direction: column; gap: 10px; }
.nbp-bar { min-height: 64px; }
.nbp-bar .ndp-tbtext { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.nbp-bar.me .ndp-tbtext > b { font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif; font-style: normal; font-weight: 900; font-size: 30px; letter-spacing: .01em; }
.nbp-bar.me { animation: nup-throb 1.6s ease-in-out infinite; }
.nbp-bar.me.pop { animation: nup-pop .35s cubic-bezier(.2,1.4,.4,1) both, nup-throb 1.6s ease-in-out .4s infinite; }
.nbp-bar.idle { background: rgba(6,20,40,.72); border: 1px solid rgba(140,190,240,.18); }
body.nbp-myturn::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 15; box-shadow: inset 0 0 0 5px #ffc400, inset 0 0 50px rgba(255,196,0,.45); animation: nbp-frame 1.6s ease-in-out infinite; }
@keyframes nbp-frame { 50% { box-shadow: inset 0 0 0 7px #ffc400, inset 0 0 80px rgba(255,196,0,.6); } }

/* ---- the ocean ---- */
.nbp-boardwrap { display: flex; justify-content: center; margin: 0 -11px; }
.nb-case.ph {
  grid-template-columns: calc(var(--cell) * .46) calc(var(--cell) * 10);
  grid-template-rows: calc(var(--cell) * .44) calc(var(--cell) * 10);
  padding: calc(var(--cell) * .06) calc(var(--cell) * .12) calc(var(--cell) * .12) calc(var(--cell) * .04);
  border-radius: calc(var(--cell) * .3);
}
.nb-case.ph .nb-labels { font-size: calc(var(--cell) * .36); }
.nb-case.placing { touch-action: none; }
.nb-case.ph.live .nb-c.open { cursor: pointer; }
.nb-case.ph.live .nb-c.open:active::before { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 0 calc(var(--cell) * .08) rgba(255,214,10,.8); }
.nb-case.ph.live { box-shadow: inset 0 2px 0 rgba(255,255,255,.75), inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 3px #ffc400, 0 0 26px rgba(255,196,0,.5), 0 10px 26px rgba(0,0,0,.35); }
.nb-case.ph .nb-piece.sel { filter: drop-shadow(0 0 calc(var(--cell) * .08) #ffd60a) drop-shadow(0 0 calc(var(--cell) * .16) rgba(255,214,10,.8)); }
.nb-case.ph .nb-piece.lifted { opacity: .35; }
.nb-piece.nbp-ghost { z-index: 5; opacity: .85; }
.nb-piece.nbp-ghost.ok { filter: drop-shadow(0 0 calc(var(--cell) * .1) #4ade80) drop-shadow(0 calc(var(--cell) * .12) calc(var(--cell) * .12) rgba(0,0,0,.45)); }
.nb-piece.nbp-ghost.bad { filter: drop-shadow(0 0 calc(var(--cell) * .1) #ff453a) grayscale(.3); opacity: .6; }
.nb-case.locked .nb-ocean::after { content: ''; position: absolute; inset: 0; background: rgba(0,30,20,.12); pointer-events: none; }

/* ---- the shipyard (placing) ---- */
.nbp-yard { display: grid; grid-template-columns: repeat(18, 1fr); gap: 8px 6px; touch-action: pan-y; }
.nbp-ys { --cell: 28px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; min-height: 64px; border: none; border-radius: 14px; background: rgba(255,255,255,.08); color: inherit; box-shadow: inset 0 0 0 1px rgba(150,190,240,.16); cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .2s; }
.nbp-ys[data-ship="cruise"] { grid-column: span 10; } .nbp-ys[data-ship="freighter"] { grid-column: span 8; }
.nbp-ys[data-ship="ferry"], .nbp-ys[data-ship="seabus"] { grid-column: span 6; } .nbp-ys[data-ship="tug"] { grid-column: span 6; }
.nbp-ysh { display: block; width: calc(var(--len) * var(--cell)); max-width: 100%; height: var(--cell); filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.nbp-ysh .nb-hull { width: 100%; height: 100%; display: block; }
.nbp-ysn { font-size: 13px; font-weight: 800; white-space: nowrap; }
.nbp-ysn small { margin-left: 5px; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 6px; background: rgba(150,190,240,.2); }
.nbp-ys.sel { box-shadow: inset 0 0 0 2.5px #ffd60a, 0 0 18px rgba(255,214,10,.45); transform: translateY(-2px); }
.nbp-ys.placed { opacity: .5; }
.nbp-ys.placed.sel { opacity: 1; }
.nbp-tick { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 14px; font-weight: 900; color: #4ade80; }
.nbp-ys:disabled { cursor: default; }
.nbp-tools { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.nbp-tools .btn { min-height: 48px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); color: #fff; }
.nbp-rot { display: inline-block; font-size: 20px; transition: transform .2s; }
.nbp-rot.v { transform: rotate(90deg); }
.nbp-ready { min-height: 56px; font-size: 18px; font-weight: 800; }
.nbp-readybox { display: flex; align-items: center; gap: 10px; }
.nbp-readyt { flex: 1; font-size: 18px; font-weight: 900; color: #4ade80; }
.nbp-readybox .btn { flex: 1; min-height: 48px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); color: #fff; }

/* ---- the battle: tabs, fire, the fleet row ---- */
.nbp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.nbp-tabs button { border: none; border-radius: 11px; background: transparent; color: rgba(235,240,250,.7); font-size: 15px; font-weight: 800; padding: 6px 6px 5px; min-height: 44px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; cursor: pointer; white-space: nowrap; overflow: hidden; }
.nbp-tabs button small { font-size: 11.5px; font-weight: 700; opacity: .75; }
.nbp-tabs button.on { background: #f4f3ee; color: #10233c; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.nbp-fire { display: flex; gap: 8px; }
.nbp-firebtn { flex: 1; min-height: 56px; font-size: 19px; font-weight: 900; letter-spacing: .04em; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); color: rgba(235,240,250,.8); }
.nbp-firebtn.armed { background: linear-gradient(180deg, #ef3b33, #b51d17); color: #fff; box-shadow: 0 8px 22px rgba(200,35,29,.45), inset 0 1px 0 rgba(255,255,255,.3); animation: nbp-arm 1.2s ease-in-out infinite; }
.nbp-firebtn.armed:disabled { animation: none; opacity: .6; }
@keyframes nbp-arm { 50% { box-shadow: 0 8px 30px rgba(239,59,51,.75), inset 0 1px 0 rgba(255,255,255,.3); } }
.nbp-clr { width: auto; min-height: 56px; padding: 0 16px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); color: #fff; }
.nbp-track { padding: 8px 10px 8px; border-radius: 14px; background: linear-gradient(180deg, #a9afb7, #c4c9cf); box-shadow: inset 0 2px 5px rgba(0,0,0,.28); }
.nbp-tlab { font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #3f4650; margin-bottom: 4px; }
.nbp-tships { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; touch-action: pan-y; }
.nbp-ts { --cell: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.nbp-tsb { position: relative; width: calc(var(--len) * var(--cell)); height: var(--cell); filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
.nbp-tsb .nb-hull { width: 100%; height: 100%; display: block; }
.nbp-ts span { font-size: 11px; font-weight: 800; color: #26303c; white-space: nowrap; }
.nbp-ts.sunk .nbp-tsb { filter: brightness(.8); transform: rotate(-5deg); }
.nbp-ts.sunk span { color: #9b1d18; text-decoration: line-through; }
.nbp-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); font-size: 9px; font-weight: 900; letter-spacing: .12em; color: #fff; background: #c8231d; padding: 0 4px; border-radius: 3px; z-index: 3; }
.nbp-last { font-size: 14px; line-height: 1.3; color: rgba(235,240,250,.75); text-align: center; padding: 0 6px; }
.nbp-last.l-hit, .nbp-last.l-sink { color: #ff8a80; font-weight: 700; }
.nbp-last.l-win { color: #ffd60a; font-weight: 800; }

/* slide across a row of boats to read them */
.nbp-peek { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 170px); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(10,22,40,.96); color: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.5); opacity: 0; transform: translateY(10px) scale(.98); pointer-events: none; transition: opacity .12s, transform .12s; max-width: 496px; margin: 0 auto; }
.nbp-peek.on { opacity: 1; transform: none; }
.nbp-pk-art { --cell: 22px; flex: none; width: calc(var(--len) * var(--cell)); height: var(--cell); }
.nbp-pk-art .nb-hull { width: 100%; height: 100%; display: block; }
.nbp-pk-t { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; line-height: 1.3; min-width: 0; }
.nbp-pk-t b { font-size: 17px; }
.nbp-pk-t span { color: rgba(235,240,250,.78); }

/* ---- moments ---- */
.nbp-moment { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; text-align: center; background: radial-gradient(circle, color-mix(in srgb, var(--pc) 35%, rgba(4,14,30,.82)), rgba(2,8,18,.94) 75%); animation: nbp-moment 2.9s ease both; }
.nbp-moment.first { animation-duration: 2.2s; }
@keyframes nbp-moment { 0% { opacity: 0; } 8% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
.nbp-moment .big { font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif; font-size: 52px; font-weight: 900; line-height: .95; text-transform: uppercase; color: #fff; text-shadow: 0 4px 0 #c8231d, 0 10px 24px rgba(0,0,0,.5); animation: nbp-slam .5s cubic-bezier(.2,1.5,.4,1) both; max-width: 92vw; }
.nbp-moment.good .big { color: #ffd60a; }
.nbp-moment.bad .big { color: #fff; text-shadow: 0 4px 0 #7a0d09, 0 10px 24px rgba(0,0,0,.5); }
@keyframes nbp-slam { from { transform: scale(1.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.nbp-moment .who { background: rgba(0,0,0,.65); color: #fff; font-size: 16px; font-weight: 800; padding: 9px 16px; border-radius: 999px; max-width: 92vw; }
.nbp-moment.bad .who { background: #c8231d; }
.nbp-msink { position: relative; display: flex; gap: 14px; height: 120px; align-items: flex-end; padding: 0 30px 40px; overflow: hidden; border-radius: 0 0 30px 30px; }
.nbp-msink > div:not(.nb-waves) { --cell: 44px; width: calc(var(--len) * var(--cell)); max-width: 70vw; height: var(--cell); filter: drop-shadow(0 6px 6px rgba(0,0,0,.5)); animation: nb-sink 2.3s cubic-bezier(.5,0,.8,.6) .5s both; }
.nbp-msink .nb-waves { height: 58px; }
.nbp-msink .nb-hull { width: 100%; height: 100%; display: block; }
@keyframes nb-sink { 0% { transform: none; } 30% { transform: rotate(-9deg) translateY(8px); } 100% { transform: rotate(-22deg) translateY(110px); } }
.nbp-coin { width: 86px; height: 86px; perspective: 400px; }
.nbp-coin i { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #f2c94c 45%, #b9861a 100%); box-shadow: inset 0 0 0 6px rgba(140,95,10,.5), 0 8px 20px rgba(0,0,0,.4); animation: nbp-flip 1s cubic-bezier(.3,.7,.4,1) both; }
@keyframes nbp-flip { from { transform: rotateX(1440deg) translateY(-40px); } to { transform: none; } }

/* ---- the end ---- */
.nbp-final { gap: 12px; }
.nbp-fbig { font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif; font-size: 50px; font-weight: 900; line-height: .95; text-transform: uppercase; text-shadow: 0 4px 0 #c8231d; }
.nbp-fbig.won { color: #ffd60a; }
.nbp-fboards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; justify-items: center; }
.nbp-flabel { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 5px; opacity: .8; }
.nb-case.ph.sm .nb-labels { font-size: calc(var(--cell) * .4); }
.nbp-specart { --len: 4; width: 160px; height: 40px; }
.nbp-specart .nb-hull { width: 100%; height: 100%; }

/* ---- light: the chart by day ---- */
[data-theme="light"] .nbp-bar.idle { background: rgba(255,255,255,.85); border-color: rgba(16,35,60,.08); box-shadow: 0 4px 14px rgba(30,60,100,.1); color: #44556b; }
[data-theme="light"] .nbp-bar.idle b { color: #10233c; }
[data-theme="light"] .nbp-ys { background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px rgba(16,35,60,.1), 0 3px 10px rgba(30,60,100,.08); color: #10233c; }
[data-theme="light"] .nbp-ys.sel { box-shadow: inset 0 0 0 2.5px #e0a400, 0 0 16px rgba(224,164,0,.35); }
[data-theme="light"] .nbp-ysn small { background: rgba(16,35,60,.08); }
[data-theme="light"] .nbp-tick { color: #16a34a; }
[data-theme="light"] .nbp-tools .btn, [data-theme="light"] .nbp-readybox .btn, [data-theme="light"] .nbp-clr { background: rgba(255,255,255,.85); color: #10233c; box-shadow: 0 2px 8px rgba(30,60,100,.1); }
[data-theme="light"] .nbp-readyt { color: #16803c; }
[data-theme="light"] .nbp-tabs { background: rgba(16,35,60,.1); box-shadow: none; }
[data-theme="light"] .nbp-tabs button { color: #44556b; }
[data-theme="light"] .nbp-tabs button.on { background: #fff; color: #10233c; box-shadow: 0 2px 8px rgba(30,60,100,.15); }
[data-theme="light"] .nbp-firebtn { background: rgba(255,255,255,.8); color: #44556b; box-shadow: 0 2px 8px rgba(30,60,100,.1); }
[data-theme="light"] .nbp-firebtn.armed { background: linear-gradient(180deg, #ef3b33, #b51d17); color: #fff; }
[data-theme="light"] .nbp-last { color: #44556b; }
[data-theme="light"] .nbp-last.l-hit, [data-theme="light"] .nbp-last.l-sink { color: #b42318; }
[data-theme="light"] .nbp-last.l-win { color: #8a5a00; }
[data-theme="light"] .nbp-peek { background: rgba(255,255,255,.98); color: #10233c; box-shadow: 0 18px 40px rgba(30,60,100,.25); }
[data-theme="light"] .nbp-pk-t span { color: #44556b; }
[data-theme="light"] .nbp-fbig.won { color: #c8231d; text-shadow: 0 4px 0 #ffd60a; }
