:root {
  --ink: #06141d; --lacquer: #0c2230; --lacquer2: #071821; --brass: #c9a55a; --brass-hi: #f4deA0; --brass-lo: #7d6128; --gold: #ffd76a;
  --parch: #f1e4c3; --text: #e8eef0; --dim: #9db0b6; --good: #6fe08c; --bad: #ff8f78;
  --sc: "Alegreya Sans SC", "Alegreya Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #06131c; color: var(--text); font: 15px/1.35 "Alegreya Sans", system-ui, sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
canvas#sea, canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#game { cursor: crosshair; }
.hidden { display: none !important; }
h1, h2, h3, h4 { font-family: "Pirata One", "Alegreya Sans", serif; font-weight: 400; margin: 0; letter-spacing: 0.02em; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font: 700 11px/1 var(--sc); padding: 2px 5px 3px; border-radius: 4px; color: #2a1c06; background: linear-gradient(#f4deA0, #c9a55a); box-shadow: 0 1px 0 #6a4f1c, inset 0 1px 0 rgba(255, 255, 255, 0.5); }

/* The plate: lacquered sea-chest panel with a brass rim. Every panel in the game is one. */
.plate { position: relative; background: linear-gradient(170deg, rgba(18, 48, 64, 0.94), rgba(7, 24, 33, 0.96) 60%); border: 1px solid var(--brass-lo); border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(244, 222, 160, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -14px 26px rgba(0, 0, 0, 0.28), 0 10px 30px rgba(0, 0, 0, 0.55); backdrop-filter: blur(7px); }
.plate::before { content: ""; position: absolute; inset: 3px; border-radius: 9px; pointer-events: none; border: 1px solid rgba(201, 165, 90, 0.35);
  background: radial-gradient(circle at 0 0, rgba(244, 222, 160, 0.5) 0 2.5px, transparent 3.5px) 0 0 / 100% 100% no-repeat, radial-gradient(circle at 100% 0, rgba(244, 222, 160, 0.5) 0 2.5px, transparent 3.5px), radial-gradient(circle at 0 100%, rgba(244, 222, 160, 0.5) 0 2.5px, transparent 3.5px), radial-gradient(circle at 100% 100%, rgba(244, 222, 160, 0.5) 0 2.5px, transparent 3.5px); }

/* icons (inline SVG, brass) */
.ico { width: 18px; height: 18px; flex: none; background: center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.ico.coin { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c0, #f2b830 52%, #99600a); box-shadow: inset 0 0 0 1.5px rgba(120, 70, 0, 0.55), inset 0 0 0 4px rgba(255, 240, 170, 0.25); }
.ico.gun { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 10h3l1-1h12c2 0 4 1 4 3s-2 3-4 3H6l-1-1H2z' fill='%23d9bb74'/%3E%3Ccircle cx='8' cy='18' r='3.2' fill='none' stroke='%23d9bb74' stroke-width='1.8'/%3E%3Cpath d='M6 15h7l2 3H8z' fill='%239a7b3c'/%3E%3C/svg%3E"); }
.ico.glass { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9bb74' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 3h12M6 21h12M7 3c0 5 4 6 5 9-1 3-5 4-5 9M17 3c0 5-4 6-5 9 1 3 5 4 5 9'/%3E%3C/svg%3E"); }
.ico.anchor { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9bb74' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='5' r='2.3'/%3E%3Cpath d='M12 7.5V21M7 11h10M4 14c0 4 4 7 8 7s8-3 8-7'/%3E%3C/svg%3E"); }
.ico.flag { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3v18' stroke='%23d9bb74' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M6 4c5-2 7 3 13 0v9c-6 3-8-2-13 0z' fill='%23d9bb74'/%3E%3C/svg%3E"); }

/* top bar */
#top { position: fixed; top: 10px; left: 10px; display: flex; align-items: stretch; max-width: calc(100vw - 20px); padding: 3px; border-radius: 12px; }
.stat, .tbtn { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 0; background: none; border-right: 1px solid rgba(201, 165, 90, 0.25); white-space: nowrap; }
#top > :last-child { border-right: 0; }
.stat b { font: 700 18px/1 var(--sc); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.stat.quiet span { color: var(--dim); font-size: 13px; }
#gold b { color: var(--gold); text-shadow: 0 0 12px rgba(255, 200, 80, 0.35); } #gold.pop b { animation: pop 0.35s; }
@keyframes pop { 40% { transform: scale(1.18); } }
#slotsWrap.full b { color: var(--bad); }
.tbtn { font: 700 15px/1 var(--sc); letter-spacing: 0.04em; color: var(--parch); border-radius: 8px; transition: background 0.15s; }
.tbtn:hover { background: rgba(244, 222, 160, 0.12); }
.tbtn.glow { background: linear-gradient(rgba(255, 215, 106, 0.22), rgba(255, 215, 106, 0.08)); box-shadow: inset 0 0 0 1px rgba(255, 215, 106, 0.6), 0 0 18px rgba(255, 215, 106, 0.4); animation: beacon 1.8s infinite; }
@keyframes beacon { 50% { box-shadow: inset 0 0 0 1px rgba(255, 215, 106, 0.9), 0 0 26px rgba(255, 215, 106, 0.65); } }

/* feed and toast */
#feed { position: fixed; top: 64px; right: 12px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; pointer-events: none; }
#feed div { padding: 5px 12px 6px; background: linear-gradient(90deg, rgba(7, 24, 33, 0.2), rgba(7, 24, 33, 0.9) 30%); border-right: 3px solid; border-radius: 6px 0 0 6px; font-size: 14px; animation: slide 0.25s; text-shadow: 0 1px 2px #000; }
#feed b { color: var(--parch); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
#toast { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); padding: 9px 22px 10px; font: 500 16px var(--sc); letter-spacing: 0.03em; color: var(--parch); background: linear-gradient(90deg, transparent, rgba(7, 24, 33, 0.92) 18%, rgba(7, 24, 33, 0.92) 82%, transparent); border-top: 1px solid rgba(201, 165, 90, 0.5); border-bottom: 1px solid rgba(201, 165, 90, 0.5); opacity: 0; pointer-events: none; text-align: center; max-width: 92vw; }
#toast.show { animation: toast 3.2s; }
@keyframes toast { 0%, 100% { opacity: 0; } 8%, 80% { opacity: 1; } }

/* ship panel */
#shipPanel { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; width: min(560px, calc(100vw - 290px)); min-width: 300px; padding: 10px 14px 12px 10px; }
#portrait { width: 132px; height: 72px; flex: none; border-radius: 8px; background: radial-gradient(ellipse at 40% 35%, #2a8aa0, #0d3a52 70%); box-shadow: inset 0 0 0 1px var(--brass-lo), inset 0 0 14px rgba(0, 0, 0, 0.6); }
.spBody { flex: 1; min-width: 0; }
#hullName { font-family: "Pirata One", serif; font-size: 21px; line-height: 1; color: var(--parch); margin-bottom: 6px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.bar { position: relative; height: 17px; background: linear-gradient(#04090d, #0d1a22); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(201, 165, 90, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.8); }
.bar.hp > div { height: 100%; background: linear-gradient(#a6f3ae, #3dbb63 45%, #1f7f43); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); transition: width 0.15s; }
.bar.hp span { position: absolute; inset: 0; text-align: center; font: 700 12px/16px var(--sc); letter-spacing: 0.04em; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.bar.xp { height: 5px; margin-top: 4px; } .bar.xp > div { height: 100%; background: linear-gradient(90deg, #58c8ff, #c8f3ff); }
#abilities { display: flex; gap: 7px; margin-top: 8px; }
.ab { position: relative; flex: 1; display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 5px; min-width: 0; border-radius: 8px; border: 1px solid var(--brass-lo); background: linear-gradient(#1d4a5c, #0f2c3a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 0 rgba(0, 0, 0, 0.5); overflow: hidden; }
.ab:hover { border-color: var(--brass-hi); } .ab:active { transform: translateY(1px); }
.ab .an { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 700 14px var(--sc); letter-spacing: 0.03em; }
.ab kbd { position: absolute; left: 3px; top: 3px; z-index: 2; }
.aico { width: 34px; height: 34px; flex: none; border-radius: 6px; background: #0a1c26 center / 74% no-repeat; box-shadow: inset 0 0 0 1px rgba(201, 165, 90, 0.5); }
.ab[data-ab=brace] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 3v6c0 5-3.5 9-8 11-4.500-2-8-6-8-11V5z' fill='%239ec4ff'/%3E%3Cpath d='M12 5l5 2v4.500c0 3.500-2 6-5 7.500z' fill='%23d8e8ff'/%3E%3C/svg%3E"); }
.ab[data-ab=fullsail] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2v17' stroke='%23d9bb74' stroke-width='1.6'/%3E%3Cpath d='M12 3c6 3 8 9 8 14h-8z' fill='%23f1e4c3'/%3E%3Cpath d='M10 6c-4 3-6 7-6 11h6z' fill='%23cdbd94'/%3E%3Cpath d='M3 20h18l-2 2H5z' fill='%23d9bb74'/%3E%3C/svg%3E"); }
.ab[data-ab=repair] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3l7 4-3 3-2-1-9 10-3-3L14 6z' fill='%238ff0a8'/%3E%3Cpath d='M4 15l5 5-2 2-5-5z' fill='%23d9bb74'/%3E%3C/svg%3E"); }
.ab[data-ab=storm] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 11a5 5 0 019-3 4 4 0 015 4 3.500 3.500 0 01-2 6H7a3.500 3.500 0 01-1-7z' fill='%237f77b8'/%3E%3Cpath d='M13 10l-4 6h3l-2 6 6-8h-3l2-4z' fill='%23fff3a8'/%3E%3C/svg%3E"); }
.ab[data-ab=witchstorm] .aico { background: url(tex/spells/ic_witchstorm.webp) center / cover; }
.ab[data-ab=hexfire] .aico { background: url(tex/spells/ic_hexfire.webp) center / cover; }
.ab[data-ab=kraken] .aico { background: url(tex/spells/ic_kraken.webp) center / cover; }
.ab[data-ab=ghostfleet] .aico { background: url(tex/spells/ic_ghostfleet.webp) center / cover; }
.ab[data-ab=fog] .aico { background: url(tex/spells/ic_fog.webp) center / cover; }
.ab[data-ab=siphon] .aico { background: url(tex/spells/ic_siphon.webp) center / cover; }
.ab[data-ab=surge] .aico { background: url(tex/spells/ic_surge.webp) center / cover; }
.ab[data-ab=mark] .aico { background: url(tex/spells/ic_mark.webp) center / cover; }
.ab[data-ab=lance] .aico { background: url(tex/spells/ic_lance.webp) center / cover; }
.ab::after { content: ""; position: absolute; inset: 0; background: conic-gradient(rgba(2, 8, 12, 0.78) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.ab .cd { position: absolute; right: 8px; z-index: 2; font: 700 17px var(--sc); color: var(--gold); text-shadow: 0 1px 3px #000; }
.ab.locked { filter: grayscale(0.9) brightness(0.7); }
#mapFrame { position: fixed; right: 12px; bottom: 12px; padding: 5px; line-height: 0; }
#minimap { width: 240px; height: 180px; border-radius: 7px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
.rose { position: absolute; left: -11px; top: -11px; width: 34px; height: 34px; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='15' fill='%230c2230' stroke='%23c9a55a' stroke-width='2'/%3E%3Cpath d='M20 4l4 16-4 16-4-16z' fill='%23f4dea0'/%3E%3Cpath d='M4 20l16-4 16 4-16 4z' fill='%23c9a55a'/%3E%3Cpath d='M20 4l4 16h-4z' fill='%23d8483a'/%3E%3C/svg%3E"); }

/* shop */
#shop { position: fixed; left: 10px; top: 62px; bottom: 12px; width: min(780px, calc(100vw - 20px)); display: flex; flex-direction: column; }
#shop header { display: flex; align-items: center; gap: 14px; padding: 12px 16px 10px; border-bottom: 1px solid rgba(201, 165, 90, 0.35); }
#shop h2 { font-size: 30px; line-height: 1; background: linear-gradient(#fff3c8, #c9a55a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); }
#shopTabs { display: flex; gap: 4px; flex: 1; }
#shopTabs button { padding: 7px 18px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font: 700 16px var(--sc); letter-spacing: 0.05em; }
#shopTabs button.on { color: var(--gold); border-bottom-color: var(--gold); text-shadow: 0 0 12px rgba(255, 200, 80, 0.4); }
#shopClose { width: 32px; height: 32px; border-radius: 50%; background: rgba(244, 222, 160, 0.1); border: 1px solid var(--brass-lo); font-size: 20px; line-height: 1; color: var(--parch); }
#shopBody { overflow-y: auto; padding: 12px 16px 16px; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: var(--brass-lo) transparent; }
.hint { color: var(--dim); margin: 0 0 10px; } .hint b { color: var(--text); }
.warn { margin: 0 0 10px; padding: 8px 12px; background: rgba(224, 112, 60, 0.14); border: 1px solid rgba(224, 112, 60, 0.5); border-radius: 8px; }
.fams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fam h4, .line h4, h4.sec { font-size: 22px; color: var(--parch); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fam h4 span, .line h4 span, h4.sec span { font: 500 13px var(--sc); letter-spacing: 0.03em; color: var(--dim); }
.fam p { margin: 2px 0 8px; color: var(--dim); font-size: 13px; min-height: 2.6em; }
h4.sec { margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid rgba(201, 165, 90, 0.25); }
.row { display: flex; align-items: center; gap: 5px; padding: 5px 7px; margin-bottom: 4px; border-radius: 7px; background: linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.row.poor .cost { color: var(--bad); } .row.poor .gn b { opacity: 0.65; }
.row .gn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .gn b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .gn em { font-style: normal; color: var(--gold); letter-spacing: 2px; margin-left: 6px; }
.row small { color: var(--dim); font-size: 12px; } .row small i { color: var(--good); font-style: normal; }
.row .cost { color: var(--gold); font: 700 15px var(--sc); font-variant-numeric: tabular-nums; margin-right: 2px; }
.row button, .hullcard button { padding: 4px 8px 5px; font: 700 13px var(--sc); letter-spacing: 0.03em; color: #10240f; border: 0; border-radius: 6px; background: linear-gradient(#b9f0a4, #5fbf62); box-shadow: 0 2px 0 #2c6a33, inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.row button:active, .hullcard button:active { transform: translateY(1px); box-shadow: 0 1px 0 #2c6a33; }
.row button[data-act="sell"] { color: #2a1206; background: linear-gradient(#f0c9a4, #c9814f); box-shadow: 0 2px 0 #7a4526, inset 0 1px 0 rgba(255, 255, 255, 0.5); }
button:disabled { opacity: 0.28; cursor: default; filter: grayscale(0.8); }
.row.big { padding: 12px 14px; } .row.big .gn b { font-size: 18px; } .row.big button { padding: 9px 20px; font-size: 15px; }
.owned { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 10px; }
.hulls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hullcard { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; margin-top: 9px; border-radius: 10px; background: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); }
.hullcard.mine { box-shadow: inset 0 0 0 1px var(--gold), 0 0 16px rgba(255, 215, 106, 0.25); }
.hullcard canvas { width: 100%; height: 104px; border-radius: 8px; background: radial-gradient(ellipse at 40% 35%, #2b8fa6, #0d3a52 72%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(0, 0, 0, 0.45); }
.hullcard b { font-family: "Pirata One", serif; font-size: 22px; font-weight: 400; color: var(--parch); }
.hullcard small { display: block; color: var(--dim); } .hullcard small.ab { all: unset; display: block; color: #9bd9ff; font-size: 12px; }
.hullcard button { padding: 8px; font-size: 15px; } .hullcard.poor button { background: linear-gradient(#d9c8b0, #a8927a); box-shadow: 0 2px 0 #5f4f3c; }
.tag { align-self: flex-start; padding: 3px 11px 4px; border-radius: 999px; background: rgba(255, 215, 106, 0.16); color: var(--gold); font: 700 13px var(--sc); letter-spacing: 0.04em; }

/* overlays */
#score { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: min(840px, 94vw); padding: 16px 18px; pointer-events: none; }
#score .team { border-top: 3px solid var(--tc); padding-top: 6px; } #score h4 { font-size: 24px; color: var(--tc); }
#score table { width: 100%; border-collapse: collapse; font-size: 14px; } #score th { text-align: left; color: var(--dim); font: 500 13px var(--sc); letter-spacing: 0.04em; } #score td, #score th { padding: 3px 4px; }
#score tr.me td { color: var(--gold); font-weight: 700; } #score i { color: var(--dim); font-size: 12px; }
#dead { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); padding: 14px 34px 16px; text-align: center; background: linear-gradient(90deg, transparent, rgba(40, 6, 6, 0.86) 20%, rgba(40, 6, 6, 0.86) 80%, transparent); border-top: 1px solid rgba(255, 110, 90, 0.6); border-bottom: 1px solid rgba(255, 110, 90, 0.6); }
#dead h3 { font-size: 46px; line-height: 1; color: #ff9a86; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); } #dead p { margin: 4px 0 0; } #dead b { color: var(--gold); font-size: 20px; }

#win h1 { font-size: clamp(56px, 9vw, 110px); line-height: 1; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 40px rgba(0, 0, 0, 0.6)); }
#win.won h1 { background-image: linear-gradient(#fff6cf, #ffd76a 45%, #b9801d); } #win.lost h1 { background-image: linear-gradient(#ffd3c8, #ff8f78 45%, #a13322); }


/* menu */
#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(4, 16, 24, 0.15), rgba(4, 12, 18, 0.72)); overflow-y: auto; touch-action: pan-y; }
#menu .card { width: min(520px, 100%); padding: 30px 34px 24px; border-radius: 18px; text-align: center; }
#menu .card::before { inset: 5px; border-radius: 14px; }
#menu .over { margin: 0; font: 700 15px var(--sc); letter-spacing: 0.42em; text-indent: 0.42em; color: var(--brass); text-transform: uppercase; }
#menu h1 { font-size: clamp(60px, 13vw, 92px); line-height: 0.95; margin-top: 4px; background: linear-gradient(#fffbe6 10%, #ffe08a 45%, #c58a1e 80%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #3a2506) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }
.rule { height: 12px; margin: 12px auto 12px; width: 76%; background: linear-gradient(90deg, transparent, var(--brass) 20%, var(--brass) 80%, transparent) center / 100% 1px no-repeat; display: flex; justify-content: center; align-items: center; }
.rule i { width: 10px; height: 10px; transform: rotate(45deg); background: linear-gradient(135deg, var(--brass-hi), var(--brass-lo)); box-shadow: 0 0 0 3px #0c2230; }
#menu .lede { margin: 0 0 20px; font-size: 19px; color: var(--parch); }
#menu form { display: grid; gap: 12px; text-align: left; } #menu label { display: grid; gap: 4px; font: 700 14px var(--sc); letter-spacing: 0.06em; color: var(--brass-hi); } #menu label small { font: 400 13px "Alegreya Sans", sans-serif; letter-spacing: 0; color: var(--dim); display: inline; margin-left: 6px; }
#menu input { padding: 11px 13px; font: 500 18px "Alegreya Sans", sans-serif; color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--brass-lo); border-radius: 9px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6); -webkit-user-select: text; user-select: text; }
#menu input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
#menu button[type=submit] { margin-top: 4px; padding: 12px; font-family: "Pirata One", serif; font-size: 30px; color: #2a1905; border: 0; border-radius: 10px; background: linear-gradient(#fff0b0, #f2c04a 45%, #d0901c); box-shadow: 0 5px 0 #7a4f08, 0 10px 24px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.6); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
#menu button[type=submit]:hover { filter: brightness(1.06); } #menu button[type=submit]:active { transform: translateY(3px); box-shadow: 0 2px 0 #7a4f08; }
#menuNote { min-height: 1.2em; margin: 10px 0 0; color: var(--bad); }
.how { margin: 14px 0 0; padding: 12px 0 0 18px; text-align: left; color: var(--dim); font-size: 14px; border-top: 1px solid rgba(201, 165, 90, 0.25); } .how li { margin: 4px 0; } .how b { color: var(--text); }

@media (max-width: 760px) {
  .fams, .hulls, .owned, #score { grid-template-columns: 1fr; }
  #mapFrame { bottom: auto; top: 62px; right: 8px; padding: 3px; } #minimap { width: 128px; height: 96px; } .rose { width: 26px; height: 26px; left: -8px; top: -8px; }
  #feed { top: 176px; }
  #shipPanel { width: calc(100vw - 16px); bottom: 8px; padding: 8px 10px 9px 8px; gap: 8px; } #portrait { width: 92px; height: 52px; }
  .stat, .tbtn { padding: 6px 9px; gap: 5px; } .stat.quiet span, .tbtn kbd, .stat.quiet .ico { display: none; } .stat b { font-size: 16px; }
  #shop { top: 58px; bottom: 8px; left: 6px; width: calc(100vw - 12px); }
  .ab .an { display: none; } .ab { justify-content: center; padding: 5px; } .ab .cd { right: 50%; transform: translateX(50%); }
  #menu .card { padding: 24px 20px 18px; }
}

@media (max-width: 1180px) and (min-width: 761px) { #shipPanel { left: 12px; transform: none; width: calc(100vw - 296px); } }

/* ---- Pirates of the Endless look: storm black, bone gold, ghost teal ---- */
:root { --lacquer: #0a1014; --lacquer2: #05080b; --brass: #b89355; --brass-hi: #e6cf96; --brass-lo: #6a5226; --gold: #f0c66a; --parch: #e9dcbb; --teal: #3fe6cf; }
.plate { background: linear-gradient(175deg, rgba(14, 22, 27, 0.95), rgba(4, 7, 10, 0.97) 65%); border-color: var(--brass-lo);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(230, 207, 150, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -18px 30px rgba(0, 0, 0, 0.4), 0 12px 34px rgba(0, 0, 0, 0.7), 0 0 26px rgba(63, 230, 207, 0.05); }
.plate::before { border-color: rgba(184, 147, 85, 0.3); }
#menu { background: linear-gradient(rgba(2, 6, 8, 0.35), rgba(2, 6, 8, 0.82)), url("art/title-bg.jpg") center / cover no-repeat; }
#menu .card { width: min(500px, 100%); padding: 18px 32px 22px; background: linear-gradient(175deg, rgba(8, 14, 18, 0.9), rgba(2, 5, 7, 0.94)); }
#menu .logo { display: block; width: min(360px, 82%); margin: -4px auto -8px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.8)); }
#menu h1 { font-size: clamp(34px, 8vw, 46px); letter-spacing: 0.08em; background: linear-gradient(#f4ecd2, #c9a45c); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 0 #000); }
#menu .lede { font-size: 17px; margin-bottom: 16px; }
#menu input { background: rgba(0, 0, 0, 0.5); }
#menu input:focus { outline-color: var(--teal); }
#menu button[type=submit] { color: #1c1204; background: linear-gradient(#f3dfa2, #c79a45 50%, #9a7026); box-shadow: 0 5px 0 #4a3510, 0 10px 26px rgba(0, 0, 0, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.45); }
#portrait, .hullcard canvas { background: radial-gradient(ellipse at 50% 62%, rgba(40, 150, 135, 0.45), rgba(4, 16, 20, 0.9) 68%); }
#portrait { width: 120px; height: 84px; }
.hullcard canvas { height: 150px; }
.bar.hp > div { background: linear-gradient(#8ff0cf, #2fae8c 45%, #17695a); }
.ab { background: linear-gradient(#152329, #0a1115); }
.ab:hover { border-color: var(--teal); box-shadow: 0 0 12px rgba(63, 230, 207, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.aico { background-color: #05090b; }
#shopTabs button.on { color: var(--teal); border-bottom-color: var(--teal); text-shadow: 0 0 12px rgba(63, 230, 207, 0.5); }
.tbtn.glow { background: linear-gradient(rgba(63, 230, 207, 0.2), rgba(63, 230, 207, 0.06)); box-shadow: inset 0 0 0 1px rgba(63, 230, 207, 0.6), 0 0 18px rgba(63, 230, 207, 0.35); animation: none; }
.row button, .hullcard button { color: #04140f; background: linear-gradient(#9af0dc, #33b79d); box-shadow: 0 2px 0 #145246, inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.row button[data-act="sell"] { color: #1c1204; background: linear-gradient(#e6cf96, #b08a45); box-shadow: 0 2px 0 #5a431a, inset 0 1px 0 rgba(255, 255, 255, 0.5); }
#feed div { background: linear-gradient(90deg, rgba(2, 5, 7, 0.1), rgba(2, 5, 7, 0.92) 30%); }
@media (max-width: 760px) { #portrait { width: 84px; height: 60px; } .hullcard canvas { height: 120px; } }

/* ---- ink and watercolour: the menu is a title page, not a painting from elsewhere ---- */
#menu { background: radial-gradient(ellipse at center, rgba(30, 22, 12, 0.10), rgba(30, 22, 12, 0.55)); }
#menu h1 { font-size: clamp(60px, 13vw, 92px); letter-spacing: 0.02em; }
#portrait, .hullcard canvas { background: radial-gradient(ellipse at 50% 55%, #9cc3c4, #5d8f9a 75%); }

/* ---- crew lobby ---- */
#menu button.second, #lobby button.second { padding: 10px; font: 700 17px var(--sc); letter-spacing: 0.06em; color: var(--brass-hi); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--brass-lo); border-radius: 10px; cursor: pointer; }
#menu button.second:hover, #lobby button.second:hover { border-color: var(--gold); color: #fff3c8; }
#lobby { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(4, 16, 24, 0.2), rgba(4, 12, 18, 0.78)); overflow-y: auto; z-index: 30; }
#lobby.hidden { display: none; }
#lobby { align-items: flex-start; }
#lobby .card { width: min(720px, 100%); margin: auto; padding: 24px 28px 20px; border-radius: 18px; }   /* margin:auto centres without clipping the top on short screens */
#lobby .card::before { inset: 5px; border-radius: 14px; }
#lobby .over { margin: 0; text-align: center; font: 700 14px var(--sc); letter-spacing: 0.42em; text-indent: 0.42em; color: var(--brass); text-transform: uppercase; }
#lobby h2 { margin: 2px 0 12px; text-align: center; font: 400 56px/1 "Pirata One", serif; letter-spacing: 0.08em; color: #ffe08a; text-shadow: 0 3px 0 #3a2506, 0 8px 18px rgba(0, 0, 0, 0.6); }
#lobby .invite { display: flex; gap: 8px; margin-bottom: 16px; }
#lobby .invite input { flex: 1; min-width: 0; padding: 9px 12px; font: 500 15px "Alegreya Sans", sans-serif; color: var(--dim); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--brass-lo); border-radius: 9px; }
#lobby .invite button { padding: 0 14px; font: 700 15px var(--sc); color: #2a1905; border: 0; border-radius: 9px; background: linear-gradient(#fff0b0, #e8b440); cursor: pointer; }
#lobby .sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#lobby .side { padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.32); border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); box-shadow: inset 0 3px 0 color-mix(in srgb, var(--tc) 70%, transparent); display: flex; flex-direction: column; }
#lobby .side h4 { margin: 2px 0 8px; font: 700 17px var(--sc); letter-spacing: 0.05em; color: var(--tc); }
#lobby .side ul { list-style: none; margin: 0 0 10px; padding: 0; flex: 1; min-height: 64px; }
#lobby .side li { padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 17px; color: var(--parch); }
#lobby .side li.me { color: #ffe9a8; font-weight: 700; }
#lobby .side li.ai { color: var(--dim); font-style: italic; }
#lobby .side li b { margin-left: 6px; font: 700 11px var(--sc); letter-spacing: 0.1em; color: #2a1905; background: var(--gold); border-radius: 4px; padding: 1px 5px; vertical-align: 2px; }
#lobby .side button { padding: 7px; font: 700 14px var(--sc); color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; cursor: pointer; }
#lobby .side button:disabled { opacity: 0.35; cursor: default; }
#lobby h4.sec { margin: 18px 0 8px; font: 700 15px var(--sc); letter-spacing: 0.08em; color: var(--brass-hi); }
#lobby h4.sec span { font: 400 14px "Alegreya Sans", sans-serif; letter-spacing: 0; color: var(--dim); margin-left: 6px; }
#lbSettings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
#lbSettings label { display: grid; gap: 3px; font: 700 14px var(--sc); letter-spacing: 0.04em; color: var(--parch); }
#lbSettings label small { font: 400 13px "Alegreya Sans", sans-serif; letter-spacing: 0; color: var(--dim); }
#lbSettings select { padding: 7px 9px; font: 500 16px "Alegreya Sans", sans-serif; color: var(--text); background: rgba(0, 0, 0, 0.4); border: 1px solid var(--brass-lo); border-radius: 8px; }
#lbSettings select:disabled { opacity: 0.75; border-color: rgba(255, 255, 255, 0.08); }
#lobby .acts { display: grid; grid-template-columns: 1fr 1fr 1fr 2fr; gap: 10px; margin-top: 18px; }
#lbStart { padding: 10px; font: 400 28px "Pirata One", serif; color: #2a1905; border: 0; border-radius: 10px; background: linear-gradient(#fff0b0, #f2c04a 45%, #d0901c); box-shadow: 0 5px 0 #7a4f08, 0 10px 24px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.6); cursor: pointer; }
#lbStart:disabled { filter: grayscale(0.8) brightness(0.7); cursor: default; }
#lbNote { margin: 10px 0 0; min-height: 1.2em; text-align: center; color: var(--dim); }
@media (max-width: 560px) { #lobby .sides, #lbSettings { grid-template-columns: 1fr; } #lobby .acts { grid-template-columns: 1fr 1fr 1fr; } #lobby #lbStart { grid-column: 1 / -1; } #lobby h2 { font-size: 44px; } #lobby .card { padding: 20px 16px 16px; } }

/* ---- coach line, shop polish, narrow screens ---- */
#coach { position: fixed; left: 12px; top: 64px; max-width: min(460px, calc(100vw - 280px)); display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 9px 13px; font-size: 15px; line-height: 1.35; color: var(--parch); border-left: 3px solid var(--gold); animation: slide 0.3s; }
#coach b { color: var(--gold); } #coach kbd { font-size: 12px; }
#coachX { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--brass-lo); background: transparent; color: var(--dim); font-size: 15px; line-height: 1; padding: 0; }
#shop { width: min(1000px, calc(100vw - 20px)); }
.fams { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.row.pick { box-shadow: inset 0 0 0 1px rgba(255, 215, 106, 0.7), 0 0 12px rgba(255, 215, 106, 0.15); }
.row .gn em.best { margin-left: 7px; padding: 0 6px; border-radius: 4px; background: var(--gold); color: #2a1905; font: 700 10px/16px var(--sc); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 2px; }
.warn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .warn span { flex: 1; min-width: 200px; }
.warn button { padding: 7px 12px; font: 700 14px var(--sc); color: #2a1905; border: 0; border-radius: 8px; background: linear-gradient(#fff0b0, #e8b440); box-shadow: 0 2px 0 #7a4f08; }
.hullcard button { white-space: normal; }
@media (max-width: 760px) {
  #top { max-width: calc(100vw - 16px); }
  .tbtn { font-size: 0; gap: 0; } .tbtn .ico { margin: 0; } #lobbyBtn { font-size: 12px; }
  #shop header { gap: 6px; padding: 10px 10px 8px; } #shop h2 { font-size: 22px; } #shopTabs { gap: 0; } #shopTabs button { padding: 6px 8px; font-size: 14px; }
  #coach { top: auto; bottom: 150px; left: 8px; right: 8px; max-width: none; font-size: 14px; }
}

/* ---- phones: play sideways ---- */
#rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  body:not(.upright) #rotate { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; background: radial-gradient(ellipse at center, rgba(8, 28, 38, 0.94), rgba(3, 10, 15, 0.98)); }
  #rotate h3 { margin: 18px 0 0; font: 400 34px/1.05 "Pirata One", serif; color: #ffe08a; }
  #rotate p { margin: 0 0 18px; color: var(--parch); font-size: 17px; }
  #rotate button { padding: 9px 16px; font: 700 14px var(--sc); color: var(--dim); background: transparent; border: 1px solid var(--brass-lo); border-radius: 9px; }
  #rotate .phone { width: 64px; height: 104px; border: 4px solid var(--gold); border-radius: 12px; box-shadow: 0 0 24px rgba(255, 215, 106, 0.3); animation: turn 2.4s ease-in-out infinite; }
}
@keyframes turn { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* a phone held sideways: little height, so everything hugs the corners and the sea gets the middle */
@media (orientation: landscape) and (max-height: 540px) {
  #top { top: 6px; left: 6px; padding: 0; } .stat, .tbtn { padding: 5px 9px; gap: 5px; } .stat b { font-size: 15px; }
  .stat.quiet span, .tbtn kbd { display: none; } .tbtn { font-size: 13px; }
  #coach { top: 46px; left: 6px; max-width: min(380px, 46vw); padding: 5px 6px 6px 10px; font-size: 12.5px; line-height: 1.3; }
  #feed { top: 46px; right: 8px; } #feed div { font-size: 12px; padding: 3px 9px 4px; } #feed div:nth-child(n+4) { display: none; }
  #toast { top: 30%; font-size: 14px; padding: 6px 16px; }
  #shipPanel { left: 6px; bottom: 6px; transform: none; width: min(330px, 44vw); min-width: 0; padding: 6px 8px 7px; gap: 8px; }
  #portrait { display: none; }
  #hullName { font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar { height: 13px; } .bar.hp span { font-size: 10px; line-height: 13px; } .bar.xp { height: 3px; margin-top: 3px; }
  #abilities { margin-top: 6px; gap: 6px; }
  .ab { justify-content: center; padding: 3px; min-height: 44px; } .ab .an { display: none; } .ab .cd { right: 50%; transform: translateX(50%); } .aico { width: 36px; height: 36px; }
  #mapFrame { right: 6px; bottom: 6px; top: auto; padding: 3px; } #minimap { width: 160px; height: 120px; } .rose { width: 24px; height: 24px; left: -7px; top: -7px; }
  #shop { top: 6px; bottom: 6px; left: 6px; width: calc(100vw - 12px); }
  #shop header { padding: 6px 10px; gap: 8px; } #shop h2 { font-size: 20px; } #shopTabs button { padding: 5px 10px; font-size: 14px; }
  #shopBody { padding: 8px 10px 10px; } .fam p { display: none; } .hullcard canvas { height: 84px; }
  #score { top: 6px; bottom: 6px; transform: translateX(-50%); overflow-y: auto; padding: 10px 12px; } #score h4 { font-size: 18px; } #score table { font-size: 12px; }
  #dead { top: 18%; padding: 8px 24px 10px; } #dead h3 { font-size: 32px; }

  #menu .card, #lobby .card { padding: 14px 18px 12px; } #menu h1 { font-size: 52px; } #menu .lede { margin-bottom: 10px; font-size: 16px; } .how { display: none; }
}

/* phones: a big hold-to-talk button just left of the minimap, clear of the "Back to ship" button that sits on top
   of the minimap (open mic on the top bar still works too). Portrait phones have the minimap at the top instead. */
#pttBtn { display: none; }
@media (pointer: coarse) {
  #pttBtn { position: fixed; z-index: 30; right: 276px; bottom: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 72px; height: 72px; padding: 0; border-radius: 50%;
    border: 2px solid rgba(201, 165, 90, 0.7); background: radial-gradient(circle at 50% 35%, rgba(30, 60, 70, 0.92), rgba(6, 18, 24, 0.92)); color: var(--parch); font: 700 10px/1.05 var(--sc); letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  #pttBtn .ico { width: 26px; height: 26px; margin: 0; }
  #pttBtn.on { border-color: #8cffaa; background: radial-gradient(circle at 50% 35%, rgba(60, 140, 90, 0.95), rgba(10, 40, 24, 0.95)); color: #d8ffe2; transform: scale(1.08); }
  #pttBtn.on.talk { box-shadow: 0 0 0 4px rgba(140, 255, 170, 0.35), 0 0 22px rgba(140, 255, 170, 0.6); }
  #pttBtn.off { opacity: 0.45; }
  #pttBtn.on .ico.mic { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8.5' y='2.5' width='7' height='12' rx='3.5' fill='%238cffaa'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7' fill='none' stroke='%238cffaa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
}
@media (pointer: coarse) and (max-width: 760px) { #pttBtn { right: 10px; bottom: 150px; } }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 540px) { #pttBtn { bottom: 8px; right: 184px; width: 64px; height: 64px; } }
/* sunk while the harbour is open: the shop header carries the countdown instead of the banner covering the shop */
#shopSunk { margin-left: auto; white-space: nowrap; font: 700 15px var(--sc); color: #ff9a86; }
#shopSunk b { color: var(--gold); }

/* free camera: a way back to your ship */
#centreBtn { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); white-space: nowrap; padding: 6px 12px; font: 700 14px var(--sc); letter-spacing: 0.04em; color: #2a1905; border: 0; border-radius: 999px; background: linear-gradient(#fff0b0, #e8b440); box-shadow: 0 3px 0 #7a4f08, 0 6px 14px rgba(0, 0, 0, 0.5); line-height: 1.2; }
#centreBtn kbd { margin-left: 4px; font-size: 11px; }
@media (pointer: coarse) { #centreBtn kbd { display: none; } }
#game { cursor: grab; } #game:active { cursor: grabbing; }

/* each hull's own ability */
.ab[data-ab=boneward] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V5z' fill='%23efe3c4'/%3E%3Cpath d='M8 9h8M8 13h8M10 17h4' stroke='%237a6a4a' stroke-width='1.6'/%3E%3C/svg%3E"); }
.ab[data-ab=cutrun] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2v17' stroke='%23d9bb74' stroke-width='1.6'/%3E%3Cpath d='M12 3c6 3 8 9 8 14h-8z' fill='%23f1e4c3'/%3E%3Cpath d='M2 20h18M4 23h12' stroke='%239fe6ec' stroke-width='1.6'/%3E%3C/svg%3E"); }
.ab[data-ab=wraithwalk] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 21V11a7 7 0 0114 0v10l-2.5-2-2.5 2-2-2-2 2-2.5-2z' fill='%236dffc8' fill-opacity='.85'/%3E%3Ccircle cx='9.5' cy='11' r='1.6' fill='%23062a25'/%3E%3Ccircle cx='14.5' cy='11' r='1.6' fill='%23062a25'/%3E%3C/svg%3E"); }
.ab[data-ab=graveshock] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%236dffc8' stroke-width='1.6'/%3E%3Cpath d='M13 4l-4 8h3l-2 8 6-10h-3l2-6z' fill='%23e8fff8'/%3E%3C/svg%3E"); }
.ab[data-ab=dreadblast] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.5 6 6-2.5-2.5 6 6 1.5-6 1.5 2.5 6-6-2.5L12 23l-2.5-6-6 2.5 2.5-6L0 12l6-1.5L3.5 4.5l6 2.5z' fill='%23ffb050'/%3E%3Ccircle cx='12' cy='12' r='4' fill='%23fff3c8'/%3E%3C/svg%3E"); }
.ab[data-ab=blacktide] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12m-1 0a1 1 0 112 0 3 3 0 11-6 0 5 5 0 1110 0 7 7 0 11-14 0 9 9 0 1118 0' fill='none' stroke='%239fe6ec' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ab[data-ab=soulchain] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='9' width='9' height='6' rx='3' fill='none' stroke='%236dffc8' stroke-width='2'/%3E%3Crect x='13' y='9' width='9' height='6' rx='3' fill='none' stroke='%236dffc8' stroke-width='2'/%3E%3Cpath d='M8 12h8' stroke='%23e8fff8' stroke-width='2'/%3E%3C/svg%3E"); }
.ab[data-ab=drivecannon] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 15l13-7 3 4-13 7z' fill='%23b9824a'/%3E%3Ccircle cx='7' cy='19' r='3' fill='%235a3a22'/%3E%3Ccircle cx='21' cy='8' r='2' fill='%23ffb050'/%3E%3C/svg%3E"); }
.ab[data-ab=barrage] .aico { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l7-12M9 21l6-13M14 21l6-12' stroke='%23ff8a3a' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M11 8l-1-4 3 2zM15 8l0-4 2 3zM20 9l1-4-3 2z' fill='%23fff0b0'/%3E%3C/svg%3E"); }

/* install as an app */
#menu button.install { border-color: rgba(79, 224, 204, 0.55); color: #bff7ee; }
.installhint { margin: 2px 0 0; text-align: center; font-size: 14px; color: var(--dim); } .installhint b { color: var(--parch); }

/* level-up picks: a strip above the abilities, never a pause */
#perks { display: flex; align-items: stretch; gap: 5px; margin: 0 0 6px; padding: 5px; border-radius: 8px; background: rgba(255, 220, 140, 0.08); border: 1px solid rgba(255, 220, 140, 0.45); animation: perkGlow 1.6s ease-in-out infinite; }
#perks.hidden { display: none; }
#perks .pt { align-self: center; font-family: "Pirata One", serif; font-size: 15px; color: #ffe9a8; padding: 0 4px; white-space: nowrap; }
#perks .pt b { font-weight: 400; color: #fff; }
#perks .pk { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 3px; border-radius: 6px; cursor: pointer;
  background: rgba(6, 19, 24, 0.85); border: 1px solid rgba(255, 220, 140, 0.5); color: var(--parch); font: 700 13px "Alegreya Sans SC", "Alegreya Sans", sans-serif; }
#perks .pk:hover:not(:disabled) { background: rgba(255, 220, 140, 0.18); }
#perks .pk:disabled { opacity: 0.4; cursor: default; }
#perks .pk kbd { font-size: 10px; opacity: 0.7; }
#perks .pk small { font: 400 11px "Alegreya Sans", sans-serif; color: var(--dim); white-space: nowrap; }
@keyframes perkGlow { 50% { box-shadow: 0 0 12px rgba(255, 220, 140, 0.35); } }
@media (max-height: 540px) { #perks .pk small, #perks .pk kbd { display: none; } #perks .pk { padding: 6px 3px; } }

/* menu: solo first, then finder / host, then a crew code */
#menu #soloBtn { display: grid; gap: 0; line-height: 1.05; }
#menu #soloBtn small { font: 600 14px "Alegreya Sans", sans-serif; letter-spacing: 0; opacity: 0.75; }
#menu .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#menu .coderow { display: flex; gap: 8px; } #menu .coderow input { flex: 1; min-width: 0; } #menu .coderow button { padding: 0 18px; }
#menu .hidden, #finder.hidden { display: none; }
/* battle finder */
#finder { text-align: left; }
#finder .fhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
#finder h3 { margin: 0; font: 400 26px "Pirata One", serif; color: #ffe08a; letter-spacing: 0.04em; }
#finder .fhead button { padding: 6px 12px; font-size: 14px; }
#finderList { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
#finderList li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--brass-lo); }
#finderList li.empty { display: block; color: var(--dim); font-size: 15px; border-style: dashed; }
#finderList .fi { flex: 1; min-width: 0; display: grid; gap: 2px; }
#finderList .fi b { font: 700 18px var(--sc); color: var(--parch); letter-spacing: 0.03em; }
#finderList .fi small { font-size: 13px; color: var(--dim); }
#finderList .st { justify-self: start; font: 700 12px var(--sc); font-style: normal; letter-spacing: 0.06em; padding: 1px 7px; border-radius: 4px; }
#finderList .st.live { color: #2a1905; background: #f2c04a; }
#finderList .st.wait { color: #072b26; background: #4fe0cc; }
#finderList .st.end { color: var(--text); background: rgba(255, 255, 255, 0.15); }
#finderList li button { flex: none; padding: 9px 14px; font: 700 15px var(--sc); color: #2a1905; border: 0; border-radius: 9px; background: linear-gradient(#fff0b0, #e8b440); cursor: pointer; }
#finderList li button:disabled { opacity: 0.4; cursor: default; }
#finder .fnote { margin: 10px 0; font-size: 14px; color: var(--dim); } #finder .fnote b { color: var(--parch); }
#finder #finderBack { width: 100%; }
@media (max-height: 540px) { #finderList { max-height: 52vh; } #menu #soloBtn small { font-size: 12px; } }

/* tall menu on short screens: scroll from the top instead of clipping it */
#menu { align-items: flex-start; } #menu .card { margin: auto; }

/* sound button: a speaker drawn in CSS, crossed out when muted */
.ico.snd { position: relative; width: 16px; height: 14px; }
.ico.snd::before { content: ""; position: absolute; left: 1px; top: 4px; width: 5px; height: 6px; background: currentColor; box-shadow: 4px 0 0 -1px currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.ico.snd::after { content: ""; position: absolute; left: 5px; top: 1px; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 7px solid currentColor; }
#soundBtn[data-mode="off"] { opacity: 0.6; } #soundBtn[data-mode="off"] .ico.snd { background: linear-gradient(45deg, transparent 45%, currentColor 45%, currentColor 55%, transparent 55%); }

#menu .credit { margin: 12px 0 0; font-size: 12px; color: var(--dim); text-align: center; } #menu .credit a { color: var(--brass-hi); }
@media (max-height: 540px) { #menu .credit { font-size: 11px; margin-top: 6px; } }

/* scoreboard: tappable, with a close button (it covers the top bar on phones) */
#score { pointer-events: auto; cursor: pointer; z-index: 25; }
#score .sbx { position: absolute; top: 6px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--brass-lo); background: rgba(0, 0, 0, 0.5); color: var(--parch); font-size: 26px; line-height: 1; cursor: pointer; z-index: 1; }
#score .sbh { position: absolute; top: 14px; right: 56px; margin: 0; font-size: 12px; color: var(--dim); }
@media (pointer: fine) { #score .sbh { display: none; } }

/* the hold: four supply slots under the abilities */
#hold { display: flex; gap: 6px; margin-top: 6px; }
#hold .slot { position: relative; flex: 1; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--brass-lo); background: linear-gradient(#2a2216, #15100a); cursor: pointer; padding: 0; }
#hold .slot.empty { border-style: dashed; opacity: 0.45; cursor: default; background: rgba(0, 0, 0, 0.25); }
#hold .slot .iico { width: 28px; height: 28px; } #hold .slot .iico svg { width: 100%; height: 100%; display: block; }
#hold .slot kbd { position: absolute; left: 3px; top: 3px; font-size: 9px; padding: 0 3px; }
#hold .slot b { position: absolute; right: 4px; bottom: 2px; font: 700 13px var(--sc); color: #fff; text-shadow: 0 1px 2px #000; }
#hold .slot.cooling .iico { opacity: 0.35; } #hold .slot .cd { position: absolute; font: 700 15px var(--sc); color: var(--gold); text-shadow: 0 1px 3px #000; }
#hold .slot:not(.empty):hover { border-color: var(--gold); }
.supplies .row .iico { flex: none; width: 34px; height: 34px; margin-right: 8px; } .supplies .row .iico svg { width: 100%; height: 100%; display: block; }
.supplies .row .gn em { font-style: normal; font-size: 12px; color: #8cffaa; margin-left: 6px; }
#shopTabs button.hidden { display: none; }
@media (max-height: 540px) { #hold { margin-top: 4px; gap: 4px; } #hold .slot { height: 34px; } #hold .slot kbd { display: none; } }

/* end of battle */
#win { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 12px; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.75)); animation: winIn 0.6s ease-out; }
#win.hidden { display: none; }
@keyframes winIn { from { opacity: 0; } to { opacity: 1; } }
#win .winCard { width: min(1060px, 100%); max-height: 100%; overflow-y: auto; padding: 14px 20px 14px; text-align: center; }
#win.won .winCard { box-shadow: 0 0 0 1px rgba(255, 215, 106, 0.35), 0 0 80px rgba(255, 196, 80, 0.18); }
#win.lost .winCard { box-shadow: 0 0 0 1px rgba(255, 143, 120, 0.3), 0 0 80px rgba(200, 60, 40, 0.18); }
#win .winHead h1 { animation: winPop 0.7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes winPop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#win .winHead p { margin: 2px 0 10px; font: 500 17px var(--sc); letter-spacing: 0.03em; color: var(--parch); }
#win .winMe { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0 0 10px; }
#win .wt { border: 1px solid var(--brass-lo); border-radius: 8px; padding: 7px 4px; background: rgba(0, 0, 0, 0.35); }
#win .wt b { display: block; font: 400 26px "Pirata One", serif; color: var(--gold); line-height: 1.1; }
#win .wt span { font-size: 12px; color: var(--dim); }
#win .winAw { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 12px; }
#win .aw { border: 1px solid var(--tc); border-radius: 999px; padding: 4px 12px; background: rgba(0, 0, 0, 0.4); font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
#win .aw span { color: var(--brass); font: 700 11px var(--sc); letter-spacing: 0.08em; text-transform: uppercase; }
#win .aw b { color: var(--parch); } #win .aw em { color: var(--dim); font-style: normal; }
#win .winTeam { border-top: 3px solid var(--tc); margin: 0 0 10px; text-align: left; }
#win .winTeam h4 { font-size: 22px; color: var(--tc); margin: 4px 0 2px; } #win .winTeam h4 small { font: 500 12px var(--sc); color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; margin-left: 6px; }
#win .wscroll { overflow-x: auto; }
#win table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
#win th { color: var(--dim); font: 500 12px var(--sc); letter-spacing: 0.04em; text-align: right; padding: 3px 6px; white-space: nowrap; cursor: help; }
#win td { text-align: right; padding: 3px 6px; border-top: 1px solid rgba(255, 255, 255, 0.06); white-space: nowrap; }
#win th:first-child, #win td:first-child { text-align: left; }
#win td .cap { display: block; } #win td small { display: block; font-size: 11px; color: var(--dim); } #win td i { color: var(--dim); font-size: 11px; font-style: normal; }
#win td.nw { color: var(--gold); }
#win tr.me td { background: rgba(255, 215, 106, 0.08); } #win tr.me .cap { color: var(--gold); font-weight: 700; }
#win .winFoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; padding-top: 4px; }
#win .winFoot button { padding: 7px 16px; border: 1px solid var(--brass-lo); border-radius: 8px; background: rgba(0, 0, 0, 0.45); color: var(--parch); font: 700 14px var(--sc); letter-spacing: 0.04em; }
#win .winFoot button:hover { border-color: var(--brass); color: var(--gold); }
@media (max-width: 900px), (max-height: 500px) {
  #win .winCard { padding: 8px 10px; }
  #win h1 { font-size: 46px; } #win .winHead p { font-size: 13px; margin-bottom: 6px; }
  #win .winMe { gap: 5px; } #win .wt { padding: 4px 2px; } #win .wt b { font-size: 20px; } #win .wt span { font-size: 10px; }
  #win .opt { display: none; } #win table { font-size: 12px; } #win td, #win th { padding: 2px 4px; } #win .winTeam h4 { font-size: 17px; }
  #win .aw { font-size: 11px; padding: 2px 8px; }
}
@media (max-width: 600px) { #win .winMe { grid-template-columns: repeat(3, 1fr); } }

/* skill bar: icons and keys only; the name and what it does are in the tip */
.ab .an { display: none; }
.ab { justify-content: center; padding: 5px; } .ab .cd { right: 50%; transform: translateX(50%); }
/* in-game tooltip */
#tip { position: fixed; z-index: 60; max-width: min(300px, calc(100vw - 16px)); padding: 9px 12px 10px; border-radius: 9px; pointer-events: none;
  background: linear-gradient(#14262e, #0a141a); border: 1px solid var(--brass); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 10px 26px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text); text-align: left; animation: tipIn 0.12s ease-out; }
#tip.hidden { display: none; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: #0a141a; border-right: 1px solid var(--brass); border-bottom: 1px solid var(--brass); }
#tip.below::after { bottom: auto; top: -6px; transform: rotate(225deg); background: #14262e; }
#tip h5 { margin: 0 0 3px; font: 400 21px/1.1 "Pirata One", serif; color: var(--gold); display: flex; align-items: center; gap: 7px; }
#tip h5 kbd { font-size: 12px; }
#tip p { margin: 0; font-size: 14px; line-height: 1.35; color: var(--parch); }
#tip h5 + p { margin-top: 2px; }
#tip small { display: block; margin-top: 5px; font: 600 12px var(--sc); letter-spacing: 0.04em; color: var(--dim); }
.ab, #hold .slot { -webkit-touch-callout: none; user-select: none; }

/* count-in at the start of a battle */
#prep { position: fixed; z-index: 45; right: 12px; top: 80px; width: 240px; padding: 12px 16px 14px; text-align: center; pointer-events: none; }
#prep.hidden { display: none; }
#prep .pl { margin: 0; font: 700 14px var(--sc); letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); }
#prep b { display: block; font: 400 84px/1 "Pirata One", serif; background: linear-gradient(#fff6cf, #ffd76a 45%, #b9801d); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5)); }
#prep.tick b { animation: prepTick 0.5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes prepTick { from { transform: scale(1.5); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
#prep .pt { margin: 4px 0 0; font-size: 15px; color: var(--parch); }
#prep button, #dead button { pointer-events: auto; margin-top: 10px; padding: 8px 16px; border: 0; border-radius: 8px; font: 700 15px var(--sc); letter-spacing: 0.04em; color: #2a1c06; background: linear-gradient(#f4dea0, #c9a55a); box-shadow: 0 2px 0 #6a4f1c; }
#prep button kbd, #dead button kbd { margin-left: 6px; background: rgba(0, 0, 0, 0.18); color: #2a1c06; box-shadow: none; }
#prep.go b { font-size: 64px; animation: prepTick 0.6s cubic-bezier(.2, 1.6, .4, 1); }
#prep.go { animation: prepOut 1.8s ease-in forwards; }
@keyframes prepOut { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 1279px) { #prep { right: 50%; transform: translateX(50%); top: auto; bottom: 14px; width: 250px; padding: 8px 12px 10px; } #prep b { font-size: 56px; } #prep.go b { font-size: 46px; } #prep .pt { font-size: 13px; } }
@media (max-height: 500px) { #prep { bottom: 6px; width: auto; max-width: calc(100vw - 20px); display: flex; align-items: center; gap: 10px; padding: 4px 14px; white-space: nowrap; } #prep .pl { display: none; } #prep b { font-size: 34px; } #prep.go b { font-size: 30px; } #prep .pt { margin: 0; font-size: 13px; } #prep button { margin: 0; padding: 5px 10px; font-size: 13px; } }
@media (pointer: coarse) { #prep button kbd, #dead button kbd { display: none; } }

/* hull window: a row of four tiers per line, real portraits, prices you can read at a glance */
.hline { margin-top: 10px; }
.hline h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 22px; color: var(--parch); margin: 0 0 6px; }
.hline h4 span { font: 600 12px var(--sc); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.hrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hcard { display: flex; flex-direction: column; gap: 5px; padding: 7px 8px 8px; border-radius: 10px; background: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); min-width: 0; }
.hcard.mine { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 16px rgba(255, 215, 106, 0.22); }
.hpic { position: relative; aspect-ratio: 1 / 0.6; border-radius: 8px; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, rgba(40, 150, 135, 0.5), rgba(4, 16, 20, 0.92) 70%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
.hpic img { position: absolute; inset: 4% 6%; width: 88%; height: 92%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55)); user-select: none; }
.hcard.poor .hpic img { filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55)) saturate(0.6) brightness(0.8); }
.hpic .tier { position: absolute; left: 6px; top: 6px; font: 700 11px var(--sc); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-hi); background: rgba(0, 0, 0, 0.55); padding: 2px 7px; border-radius: 999px; }
.hn { font: 400 19px/1.1 "Pirata One", serif; color: var(--parch); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hst { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 12px; }
.hst li { display: flex; align-items: baseline; gap: 4px; min-width: 0; } .hst span { color: var(--dim); } .hst b { color: var(--text); font-weight: 700; margin-left: auto; }
.hst em { font-style: normal; font-size: 11px; font-weight: 700; } .hst em.up { color: var(--good); } .hst em.down { color: var(--bad); }
.hab { align-self: flex-start; font: 600 11px var(--sc); letter-spacing: 0.04em; color: #9bd9ff; border: 1px solid rgba(155, 217, 255, 0.35); border-radius: 999px; padding: 1px 8px; cursor: help; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbuy { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.hprice { display: flex; align-items: center; gap: 5px; font: 400 26px/1 "Pirata One", serif; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.hprice .ico { width: 18px; height: 18px; }
.hcard.poor .hprice { color: #c9b48a; }
.hbuy button { margin-left: auto; padding: 7px 14px; font: 700 14px var(--sc); letter-spacing: 0.04em; border: 0; border-radius: 7px; color: #04140f; background: linear-gradient(#9af0dc, #33b79d); box-shadow: 0 2px 0 #145246, inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.hbuy button:disabled { color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.08); box-shadow: none; cursor: default; }
.hbuy .tag { margin: 4px auto 2px; font: 700 13px var(--sc); letter-spacing: 0.06em; color: var(--gold); }
.hneed i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .hneed i b { display: block; height: 100%; background: linear-gradient(90deg, #b9801d, #ffd76a); }
.hneed small { display: block; margin-top: 3px; font-size: 11px; color: var(--dim); } .hneed.ok i { display: none; } .hneed.ok small { color: var(--good); }
@media (max-height: 500px), (max-width: 760px) {
  .hline { margin-top: 6px; } .hline h4 { font-size: 17px; margin-bottom: 4px; } .hrow { gap: 6px; }
  .hcard { padding: 5px 6px 6px; gap: 3px; } .hpic { aspect-ratio: 1 / 0.62; } .hn { font-size: 15px; } .hst { font-size: 10.5px; gap: 0 5px; } .hst em { font-size: 10px; }
  .hab { display: none; } .hprice { font-size: 20px; } .hbuy button { padding: 5px 9px; font-size: 12px; } .hneed small { font-size: 10px; }
}
@media (max-width: 560px) { .hrow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* crew voice: the mic button, and who on your side is aboard and talking */
.ico.mic { width: 16px; height: 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8.5' y='2.5' width='7' height='12' rx='3.5' fill='%23a8a08a'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7' fill='none' stroke='%23a8a08a' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M4 3l16 18' stroke='%23ff6a5a' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
#micBtn.on .ico.mic, #allBtn.on .ico.mic, #voice .on .ico.mic { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8.5' y='2.5' width='7' height='12' rx='3.5' fill='%238cffaa'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M8.5 21h7' fill='none' stroke='%238cffaa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
#micBtn.on { background: linear-gradient(rgba(140, 255, 170, 0.2), rgba(140, 255, 170, 0.06)); box-shadow: inset 0 0 0 1px rgba(140, 255, 170, 0.55); }
#micBtn.on.talk { box-shadow: inset 0 0 0 1px rgba(140, 255, 170, 0.9), 0 0 14px rgba(140, 255, 170, 0.5); }
#lobby #lbMic.on, #lobby #lbMic.on:hover, #lobby #lbAll.on, #lobby #lbAll.on:hover { color: #04140f; background: linear-gradient(#9af0dc, #33b79d); }
#voice { position: fixed; left: 10px; top: 40%; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
#voice div { display: flex; align-items: center; gap: 6px; padding: 3px 10px 4px 7px; max-width: 170px; font-size: 13px; color: var(--parch); background: rgba(7, 24, 33, 0.72); border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: box-shadow 0.12s; }
#voice div.talk { box-shadow: inset 0 0 0 1.5px #8cffaa, 0 0 12px rgba(140, 255, 170, 0.45); color: #fff; }
#voice div .ico.mic { flex: none; width: 13px; height: 13px; }
#voice div.me { color: var(--gold); }
#voice p { margin: 2px 0 0; max-width: 220px; font-size: 12px; color: var(--bad); background: rgba(7, 24, 33, 0.8); padding: 4px 8px; border-radius: 6px; }
@media (max-width: 760px), (max-height: 540px) { #voice { top: 34%; left: 6px; } #voice div { font-size: 11.5px; max-width: 130px; } }

/* All voice is orange so it is never mistaken for Team: the other side can hear you */
#allBtn.on { background: linear-gradient(rgba(255, 150, 60, 0.26), rgba(255, 150, 60, 0.08)); box-shadow: inset 0 0 0 1px rgba(255, 170, 90, 0.7); color: #ffd2a8; }
#allBtn.on.talk { box-shadow: inset 0 0 0 1px rgba(255, 170, 90, 1), 0 0 14px rgba(255, 150, 60, 0.55); }
#lobby #lbAll.on, #lobby #lbAll.on:hover { background: linear-gradient(#ffd0a0, #e0802c); }
#micBtn, #allBtn { gap: 5px; } #micBtn { border-right: 0; padding-right: 6px; } #allBtn { padding-left: 6px; }
#voice div { border-left: 3px solid var(--tc); }
#voice div.foe { background: rgba(40, 14, 10, 0.78); }
#voice div em { font-style: normal; font: 700 10px var(--sc); letter-spacing: 0.06em; text-transform: uppercase; color: #ffb070; margin-left: 2px; }
@media (max-width: 760px), (max-height: 540px) { #micBtn kbd, #allBtn kbd { display: none; } #micBtn .mt, #allBtn .mt { display: inline; font-size: 12px; } }

/* witchcraft picker (Refit tab and free ports) */
.sph { margin: 16px 0 8px; font-size: 18px; color: var(--text); } .sph small { font-size: 12px; color: var(--dim); font-weight: normal; margin-left: 6px; }
.spgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.spc { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto 1fr auto; gap: 2px 9px; text-align: left; padding: 8px; border-radius: 10px; background: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.spc i { grid-row: 1 / 4; width: 52px; height: 52px; border-radius: 8px; background: #0a1c26 center / cover; box-shadow: inset 0 0 0 1px rgba(201, 165, 90, 0.5); }
.spc b { font-size: 14px; } .spc small { font-size: 11px; color: var(--dim); line-height: 1.3; } .spc em { font-size: 10.5px; font-style: normal; color: var(--brass, #d9bb74); }
.spc.on { box-shadow: inset 0 0 0 2px var(--brass, #d9bb74), 0 0 12px rgba(217, 187, 116, 0.35); background: linear-gradient(rgba(217, 187, 116, 0.18), rgba(217, 187, 116, 0.05)); }
.spc:disabled { cursor: default; color: var(--text); } .spc:not(.on):disabled { opacity: 0.7; } .spc:not(:disabled):hover { background: linear-gradient(rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)); }
@media (max-width: 900px) { .spgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .spc small { display: none; } }
