:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  background: #071d2e;
  color: #ecf9ff;
}
* { box-sizing: border-box; min-width: 0; }
body { margin: 0; min-height: 100vh; background: linear-gradient(145deg, #071d2e 0%, #0b3954 52%, #061826 100%); }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; transition: transform .15s ease, filter .15s ease; white-space: normal; overflow-wrap: anywhere; }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #f6d87a; outline-offset: 2px; }
#app { position: relative; width: min(1000px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 32px; overflow-wrap: anywhere; }
header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.logo { color: inherit; font-size: 1.1rem; font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.logo span { vertical-align: middle; }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.room-pill, .phase { border: 1px solid #6ab4cc66; color: #bdefff; padding: 4px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.exit-button { min-height: 30px; background: transparent; border: 1px solid #77b7c866; border-radius: 999px; color: #cdeef7; padding: 5px 9px; font-size: .85rem; font-weight: 800; }
.panel { background: #08283bcc; border: 1px solid #65b8d633; box-shadow: 0 12px 36px #00101a44; backdrop-filter: blur(8px); border-radius: 14px; }
.ocean-glow { position: fixed; pointer-events: none; border-radius: 999px; filter: blur(65px); opacity: .2; }
.glow-one { width: min(240px, 25vw); height: 240px; background: #00a5cf; right: 0; top: 15%; }
.glow-two { width: min(200px, 25vw); height: 200px; background: #6b4dba; left: 0; bottom: 0; }
.eyebrow { margin: 0 0 6px; color: #8bd3ea; font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.4rem, 2.5vw, 2rem); letter-spacing: -.04em; }
h2 { font-size: 1.05rem; }
.notice { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: #f7c65b; color: #18212a; border-radius: 8px; font-weight: 650; padding: 8px 10px; }
.notice button { flex-shrink: 0; background: transparent; color: inherit; font-size: 1.5rem; line-height: 1; }
.welcome { display: grid; min-height: calc(100vh - 90px); grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: center; }
.brand { padding: 22px; }
.brand > span { display: block; font-size: 3rem; margin-bottom: 12px; filter: drop-shadow(0 7px 12px #001525aa); }
.brand h1 { margin-bottom: 10px; font-size: clamp(2.4rem, 5vw, 4rem); }
.brand p:last-child { max-width: 430px; color: #bee2ef; font-size: 1.05rem; line-height: 1.55; }
.join, .lobby { padding: clamp(16px, 3vw, 28px); }
.join label { display: grid; gap: 6px; color: #c7e9f3; font-weight: 700; }
input, select { width: 100%; min-height: 36px; background: #031926; border: 1px solid #74c6dd66; border-radius: 7px; color: #f3fbff; padding: 8px 9px; font-size: 16px; }
.primary, .secondary, .danger { min-height: 34px; max-width: 100%; border-radius: 8px; padding: 7px 10px; font-weight: 800; }
.primary { background: #f4c85c; color: #17232a; }
.secondary { background: #1a5875; color: #e9fbff; }
.danger { background: #db5665; color: #fff; }
.large { width: 100%; margin-top: 14px; padding: 10px; }
.or { color: #89b9c8; text-align: center; margin: 14px 0 8px; font-size: .85rem; }
.code-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.lobby { max-width: 600px; margin: 6vh auto; }
.intro, .waiting { color: #b9dce6; line-height: 1.5; }
.invite { display: flex; gap: 8px; align-items: center; background: #041d2b; padding: 8px; border-radius: 8px; margin: 16px 0; }
.invite code { color: #9fdff1; flex: 1; overflow-wrap: anywhere; }
.player-list, .roster { list-style: none; padding: 0; margin: 0; }
.player-list { display: grid; gap: 6px; margin: 18px 0; }
.player-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: #0c3449; padding: 8px; border-radius: 7px; }
.role-picker { display: grid; gap: 6px; color: #c7e9f3; font-weight: 700; margin: 14px 0 0; }
.avatar { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; background: #287496; border-radius: 50%; font-weight: 800; }
em { margin-left: auto; color: #84cbdf; font-size: .8rem; font-style: normal; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 12px; align-items: start; }
.race { padding: 16px; }
.race-title { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.race-title h1 { margin-bottom: 0; }
.phase { flex-shrink: 0; max-width: 100%; }
.water { margin: 18px -16px -16px; padding: 16px; min-height: 170px; background: repeating-linear-gradient(175deg, #0b4862 0 2px, #0b405a 3px 20px); position: relative; overflow: hidden; border-radius: 0 0 13px 13px; }
.water::before { content: ""; position: absolute; inset: 0; opacity: .35; background: linear-gradient(90deg, transparent, #79d9f755, transparent); transform: skewY(-5deg); }
.swimmers { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(112px, 100%), 1fr)); gap: 7px; width: 100%; }
.lane-entry { position: relative; }
.place { display: block; color: #b7e9f5; font-size: .75rem; font-weight: 800; margin-bottom: 4px; }
.robot-card { --robot: #f07561; position: relative; display: flex; align-items: center; gap: 6px; padding: 6px; min-height: 54px; border: 1px solid color-mix(in srgb, var(--robot), transparent 35%); border-radius: 8px; background: #061d2ccc; box-shadow: 0 4px 10px #00101a55; }
.robot-card.eliminated { filter: grayscale(1); opacity: .5; }
.robot-card.sun { --robot: #f6c950; }.robot-card.lime { --robot: #87cd61; }.robot-card.ocean { --robot: #50bcd9; }.robot-card.violet { --robot: #a587e0; }.robot-card.rose { --robot: #df719e; }
.robot-shape { width: 30px; height: 40px; flex: 0 0 30px; color: var(--robot); position: relative; display: grid; place-items: center; font-family: monospace; font-weight: 900; font-size: .9rem; text-shadow: 0 2px 4px #001a24; }
.robot-head { position: absolute; top: 0; }.robot-body { font-size: 1.5rem; }.limb { position: absolute; font-size: 1rem; }.limb.leftArm { left: 0; top: 14px; }.limb.rightArm { right: 0; top: 14px; }.limb.leftLeg { left: 4px; bottom: -1px; }.limb.rightLeg { right: 4px; bottom: -1px; }.limb.missing { opacity: .12; text-decoration: line-through; }
.robot-data { display: grid; gap: 2px; font-size: .8rem; color: #bde3ee; }.robot-data strong { color: #fff; font-size: .85rem; }.robot-data b { color: #f6d77d; }.robot-data small { overflow-wrap: anywhere; }
.compact { min-height: 54px; }.compact .robot-data span { font-size: .75rem; }
.shark { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding-top: 18px; color: #d0eefa; font-size: 2rem; filter: drop-shadow(0 5px 6px #00131f88); }.shark span, .shark b { max-width: 100%; overflow-wrap: anywhere; text-align: center; font-size: .75rem; font-weight: 700; }
.action-panel, .bite-panel { margin-top: 12px; padding: 16px; }.action-panel h2, .bite-panel h2 { margin-bottom: 6px; }.action-panel > div:first-child > p:last-child, .bite-panel > p { color: #b6dbe8; line-height: 1.5; }
.choice-group { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1fr); gap: 8px; align-items: center; border-top: 1px solid #67b2c333; padding: 9px 0; }.choice-group .robot-card { max-width: 210px; }
.cards { display: flex; flex-wrap: wrap; gap: 6px; }.card { width: 34px; height: 42px; flex: 0 0 34px; background: #e9f7f9; color: #143047; border: 2px solid transparent; border-radius: 6px; font-size: 1.2rem; font-weight: 900; }.card.selected { background: linear-gradient(145deg, #f38a6f, #cc4d5e); color: #fff9df; border-color: #ffe18b; box-shadow: 0 0 0 2px #f7c95a66, 0 7px 14px #45182588; text-shadow: 0 1px 2px #571a22aa; transform: translateY(-3px); }
.shark-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }.shark-card { min-height: 36px; flex: 1 1 110px; padding: 9px 8px; background: #d8e8ed; color: #113043; border: 2px solid transparent; border-radius: 7px; font-weight: 850; }.shark-card.selected { border-color: #f7c95a; box-shadow: 0 0 0 2px #f7c95a44; transform: translateY(-3px); }
.action-panel small { display: block; margin-top: 8px; color: #91c7d8; }
.limb-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.sidebar { padding: 12px; }.sidebar h2 { margin-bottom: 8px; }.roster { display: grid; gap: 7px; }.roster li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; font-size: .88rem; }.roster small { color: #8dbfcf; margin-left: auto; }.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #3a7184; }.status-dot.ready { background: #f0c958; box-shadow: 0 0 6px #f0c958; }
.log { margin-top: 12px; }.log ol { display: grid; gap: 7px; max-height: 280px; overflow-y: auto; padding-left: 16px; color: #b3d6e1; font-size: .85rem; line-height: 1.4; }.log li::marker { color: #5eabc2; }
.winner { margin-top: 12px; padding: 18px; text-align: center; border: 1px solid #eecd5d77; background: linear-gradient(135deg, #594720, #172f3b); border-radius: 12px; }.winner p { color: #f1cd62; text-transform: uppercase; letter-spacing: .16em; font-weight: 800; font-size: .75rem; }.winner h2 { font-size: 1.7rem; margin-bottom: 6px; }.winner span { color: #d7edf4; }
@media (max-width: 860px) {
  .welcome, .game-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome { min-height: auto; gap: 8px; }
  .brand { padding: 18px 6px; }
  .brand h1 { font-size: clamp(2.4rem, 7vw, 3.5rem); }
  .game-grid aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .log { margin-top: 0; }
}
@media (max-width: 600px) {
  #app { width: calc(100% - 16px); padding: 10px 0 24px; }
  header { margin-bottom: 12px; }
  .game-grid aside, .choice-group { grid-template-columns: minmax(0, 1fr); }
  .choice-group .robot-card { max-width: none; }
  .race-title { display: block; }
  .phase { display: inline-block; margin-top: 8px; }
  .invite { align-items: stretch; flex-direction: column; }
  .invite code { width: 100%; }
  .code-entry { grid-template-columns: minmax(0, 1fr); }
  .water { min-height: 0; }
  .swimmers { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lane-entry { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 4px; }
  .place { margin: 0; text-align: center; }
  .shark { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 12px; }
  .shark span, .shark b { text-align: left; }
  .card { width: 36px; flex-basis: 36px; }
  .limb-choices > button { flex: 1 1 100px; }
}
@media (max-width: 380px) {
  .logo span { display: none; }
  .top-actions { gap: 4px; }
  .join, .lobby { padding: 14px; }
  .brand { padding-inline: 2px; }
  .brand h1 { font-size: 2.4rem; }
  .action-panel, .bite-panel, .sidebar, .race { padding: 12px; }
  .water { margin: 14px -12px -12px; padding: 12px; }
}
