:root {
  --ink: #102923;
  --ink-soft: #25433c;
  --paper: #f5f1e7;
  --paper-2: #ebe6d9;
  --lime: #d8f35a;
  --lime-dark: #a9c53d;
  --green: #215847;
  --green-2: #2e715c;
  --orange: #f2a65a;
  --red: #da6658;
  --blue: #77a9b5;
  --line: rgba(16, 41, 35, 0.14);
  --shadow: 0 18px 60px rgba(15, 39, 33, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 15% 0%, rgba(216, 243, 90, 0.13), transparent 28rem),
    linear-gradient(180deg, #f8f5ed 0, var(--paper) 44rem);
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  z-index: 30;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 237, 0.9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.brand img { border-radius: 12px; box-shadow: 0 6px 16px rgba(33, 88, 71, 0.14); }
.brand span { display: grid; line-height: 1; gap: 5px; }
.brand strong { font-size: 15px; letter-spacing: 0.16em; }
.brand small { font-size: 8px; font-weight: 800; letter-spacing: 0.18em; color: #5f716b; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  color: #5c6d68;
  background: rgba(255, 255, 255, 0.5);
}

.mode-pill i, .signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime-dark);
  box-shadow: 0 0 0 4px rgba(169, 197, 61, 0.15);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  font-size: 20px;
  transition: transform .18s ease, background .18s ease;
}
.icon-button:hover { transform: rotate(-18deg); background: #fff; }

.app-shell { width: min(1500px, 100%); margin: 0 auto; }

.landing {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  padding: clamp(48px, 8vw, 110px) clamp(22px, 6vw, 90px);
}

.landing-copy { max-width: 720px; }
.eyebrow, .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .22em;
  color: var(--green-2);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--lime-dark); }
.landing h1 {
  margin: 20px 0 24px;
  max-width: 760px;
  font-size: clamp(48px, 7vw, 96px);
  letter-spacing: -.065em;
  line-height: .9;
  font-weight: 850;
}
.landing h1 em { color: var(--green-2); font-style: normal; font-weight: 500; }
.landing-copy > p { max-width: 620px; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.65; color: #50645e; }

.feature-list { list-style: none; padding: 0; margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.feature-list span { color: var(--green-2); font-size: 9px; border: 1px solid var(--line); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; }

.setup-card {
  background: #fff;
  border: 1px solid rgba(16, 41, 35, .12);
  border-radius: 26px;
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  position: relative;
  overflow: hidden;
}
.setup-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--lime), var(--green-2)); }
.setup-heading { display: flex; gap: 14px; align-items: center; }
.setup-heading small { font-size: 9px; letter-spacing: .2em; font-weight: 900; color: #71817c; }
.setup-heading h2 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.035em; }
.setup-card > label, .setup-card fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 9px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; color: #60736d; }
.setup-card input, .handover-note textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #f9f7f1;
  color: var(--ink);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}
.setup-card input:focus, .handover-note textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(46,113,92,.1); background: #fff; }
.setup-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: #eeece4; }
.setup-tabs button { border: 0; border-radius: 9px; background: transparent; color: #6c7c78; padding: 9px 10px; cursor: pointer; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.setup-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgba(16,41,35,.08); }
.setup-pane[hidden] { display: none; }
.compact-form, .join-form, .setup-pane { display: grid; gap: 14px; }
.compact-form label, .join-form label, .setup-pane > label, .setup-pane fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; color: #60736d; }
.form-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 9px; color: #82908c; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; background: var(--line); }
.join-form { grid-template-columns: 1fr 1fr; }
.join-form .secondary-button { grid-column: 1 / -1; }
.secondary-button { min-height: 43px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; background: #f4f2eb; color: var(--ink); }
.secondary-button:hover { transform: translateY(-1px); background: #fff; }
.player-fields { display: grid; gap: 8px; }
.player-fields label { display: grid; grid-template-columns: 36px 1fr; align-items: center; }
.player-fields label span { height: 100%; display: grid; place-items: center; background: var(--ink); color: var(--lime); border-radius: 12px 0 0 12px; font-size: 11px; }
.player-fields input { border-radius: 0 12px 12px 0; }

.primary-button, .secondary-button, .action-button {
  border: 0;
  cursor: pointer;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.primary-button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 26px rgba(16,41,35,.18);
}
.primary-button span { color: var(--lime); font-size: 20px; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16,41,35,.23); }
.primary-button:disabled, .action-button:disabled { cursor: not-allowed; opacity: .42; transform: none; box-shadow: none; }
.setup-note { margin: -8px 0 0; font-size: 10px; line-height: 1.5; color: #7a8985; text-align: center; }

.lobby { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 18px; }
.lobby-card { width: min(620px, 100%); border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: var(--shadow); padding: clamp(25px, 5vw, 44px); text-align: center; }
.lobby-code { margin: 22px auto; padding: 17px; border-radius: 14px; background: var(--ink); color: white; }
.lobby-code small { display: block; color: #9fb2ab; font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.lobby-code strong { display: block; margin-top: 5px; color: var(--lime); font-size: clamp(28px, 6vw, 44px); letter-spacing: .08em; }
.lobby h1 { margin: 10px 0; font-size: clamp(34px, 6vw, 54px); letter-spacing: -.055em; }
.lobby-intro { color: #60736d; line-height: 1.55; }
.lobby-players { margin: 22px 0; display: grid; gap: 8px; text-align: left; }
.lobby-player { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #f9f7f1; }
.lobby-player span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--lime); font-size: 10px; font-weight: 900; }
.lobby-player strong { font-size: 12px; }
.lobby-player small { margin-left: auto; color: #71817d; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.lobby-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.lobby-actions .primary-button { width: 100%; }
.lobby-actions .secondary-button { min-width: 120px; }
.waiting-banner { margin-bottom: 14px; padding: 11px 14px; border: 1px solid rgba(46,113,92,.24); background: rgba(216,243,90,.12); border-radius: 12px; color: var(--green); font-size: 11px; font-weight: 800; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.waiting-banner button { border: 0; background: transparent; color: var(--green); font-weight: 900; cursor: pointer; text-decoration: underline; }
.cloud-error { color: #963f35; background: rgba(218,102,88,.1); border-radius: 10px; padding: 10px 12px; font-size: 10px; line-height: 1.4; }

.game-view { padding: 30px clamp(16px, 3vw, 48px) 70px; }
.game-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.game-heading h1 { font-size: clamp(30px, 4vw, 54px); margin: 5px 0 0; letter-spacing: -.055em; line-height: 1; }
.game-heading h1 span { font-weight: 450; color: var(--green-2); }
.room-code { border: 1px dashed rgba(16,41,35,.25); border-radius: 13px; padding: 10px 14px; display: grid; gap: 2px; background: rgba(255,255,255,.44); }
.room-code small { font-size: 8px; letter-spacing: .17em; color: #70817c; font-weight: 900; }
.room-code strong { font-size: 13px; letter-spacing: .09em; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-card { min-width: 0; background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 15px; padding: 15px 17px; display: grid; gap: 7px; }
.stat-card small { font-size: 9px; font-weight: 900; letter-spacing: .15em; color: #6f807b; text-transform: uppercase; }
.stat-card strong { font-size: clamp(18px, 2vw, 28px); letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-track { height: 3px; border-radius: 5px; background: #dce0d6; overflow: hidden; }
.stat-track i { display: block; height: 100%; background: var(--green-2); border-radius: inherit; }

.situation-strip { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 10px; margin: 0 0 18px; }
.situation-strip article { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.situation-strip small { display: block; color: #71817d; font-size: 8px; font-weight: 900; letter-spacing: .14em; margin-bottom: 6px; }
.situation-strip article > strong { display: block; font-size: 13px; }
.situation-strip article > span { display: block; color: var(--green-2); font-size: 9px; font-weight: 800; margin-top: 4px; }
.situation-strip p { color: #667873; font-size: 9px; line-height: 1.4; margin: 7px 0 0; }
.scoreboard { background: var(--ink) !important; color: white; }
.scoreboard > div { display: grid; grid-template-columns: 22px 1fr auto; gap: 7px; align-items: center; border-top: 1px solid rgba(255,255,255,.1); padding: 5px 0; font-size: 10px; }
.scoreboard > div b { color: var(--lime); }
.scoreboard > div strong { font-size: 9px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(330px, .68fr); gap: 18px; align-items: start; }
.panel { background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 7px 24px rgba(16,41,35,.05); overflow: hidden; }
.panel-header { padding: 17px 19px; display: flex; justify-content: space-between; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.panel-header h2 { font-size: 16px; letter-spacing: -.025em; margin: 0; }
.panel-header small { font-size: 9px; font-weight: 900; letter-spacing: .13em; color: #72817d; }

.map-panel { min-height: 410px; position: relative; background: #d8ddcf; }
.map-sky { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(155deg, #dfe7d8, #bacbb9); }
.map-sky::before { content: ""; position: absolute; width: 70%; height: 70%; top: -35%; right: -15%; border: 70px solid rgba(255,255,255,.25); border-radius: 50%; }
.map-grid-lines { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(30deg, #456 1px, transparent 1px), linear-gradient(150deg, #456 1px, transparent 1px); background-size: 40px 70px; }
.map-road { position: absolute; height: 55px; background: #7a817b; border: 5px solid #a4a89f; transform: rotate(-13deg); width: 120%; left: -10%; top: 58%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.16); }
.map-road::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(255,255,255,.55); }
.cell { position: absolute; border-radius: 50% 48% 36% 28%; box-shadow: inset -20px -18px 28px rgba(16,41,35,.18), 0 16px 30px rgba(16,41,35,.12); }
.cell.active { width: 42%; height: 35%; left: 31%; top: 16%; background: repeating-linear-gradient(165deg, #9b7f55 0 11px, #ad9164 11px 22px); transform: rotate(3deg); }
.cell.legacy { width: 31%; height: 29%; right: 2%; bottom: 9%; background: repeating-linear-gradient(160deg, #70936c 0 13px, #799d74 13px 26px); transform: rotate(-8deg); }
.cell-label { position: absolute; z-index: 4; background: rgba(16,41,35,.9); color: white; border-radius: 8px; padding: 7px 9px; font-size: 9px; font-weight: 850; letter-spacing: .08em; box-shadow: 0 7px 18px rgba(16,41,35,.2); }
.cell-label.active { left: 43%; top: 21%; }
.cell-label.legacy { right: 11%; bottom: 24%; }
.map-building { position: absolute; z-index: 3; width: 74px; height: 46px; background: #eee8d5; border: 4px solid #f9f6ec; box-shadow: 10px 12px 0 rgba(16,41,35,.15); transform: skewY(-7deg); }
.map-building::before { content: ""; position: absolute; left: -5px; right: -5px; height: 15px; top: -15px; background: var(--green); transform: skewY(7deg); }
.map-building.office { left: 8%; bottom: 10%; }
.map-building.gas { width: 54px; right: 11%; top: 14%; background: #cfd7d4; }
.basin { position: absolute; width: 112px; height: 62px; left: 8%; top: 18%; background: #6f9fab; border: 9px solid #9ea99f; border-radius: 50%; transform: rotate(-8deg); box-shadow: inset 10px 8px 18px rgba(16,41,35,.2); }
.truck { position: absolute; z-index: 6; left: 22%; top: 63%; width: 62px; height: 24px; background: var(--lime); border-radius: 5px; box-shadow: 5px 7px 0 rgba(16,41,35,.18); transform: rotate(-13deg); animation: truckMove 6s ease-in-out infinite alternate; }
.truck::before { content: ""; position: absolute; width: 20px; height: 19px; right: -16px; bottom: 0; background: #f2efe7; border-radius: 3px; }
.truck::after { content: "●  ●"; position: absolute; color: var(--ink); font-size: 14px; letter-spacing: 29px; white-space: nowrap; bottom: -10px; left: 5px; }
@keyframes truckMove { to { transform: translateX(78px) rotate(-13deg); } }
.map-metrics { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 8; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.map-metric { background: rgba(248,245,237,.9); backdrop-filter: blur(8px); border-radius: 10px; padding: 9px 11px; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 9px; font-weight: 850; }
.map-metric strong { font-size: 13px; }
.map-metric.warning strong { color: #b7672e; }
.map-metric.danger strong { color: var(--red); }

.shift-panel { margin-top: 18px; }
.shift-identity { display: flex; align-items: center; gap: 11px; }
.avatar { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--lime); font-weight: 900; }
.ap-dots { display: flex; gap: 5px; }
.ap-dots i { width: 11px; height: 11px; border-radius: 3px; background: var(--lime-dark); transform: rotate(45deg); }
.ap-dots i.used { background: #d8d8cf; }
.shift-content { padding: 19px; display: grid; gap: 25px; }
.subheading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.subheading h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .11em; }
.subheading span { font-size: 10px; color: #71817d; }
.rules-note { margin: -4px 0 12px; padding: 9px 11px; border-left: 3px solid var(--lime-dark); background: rgba(216,243,90,.12); color: #63756f; font-size: 9px; line-height: 1.45; }

.deliveries { display: grid; gap: 9px; }
.delivery { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; background: #faf8f2; position: relative; overflow: hidden; }
.delivery::before { content: ""; width: 4px; position: absolute; inset: 0 auto 0 0; background: #a99367; }
.delivery[data-color="warning"]::before { background: var(--orange); }
.delivery[data-color="danger"]::before { background: var(--red); }
.delivery[data-color="slate"]::before { background: #697d7d; }
.delivery[data-color="violet"]::before { background: #8b7592; }
.delivery-main { min-width: 0; }
.delivery-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.delivery-title h4 { margin: 0; font-size: 14px; }
.code-tag, .status-tag { border: 1px solid var(--line); padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 850; color: #667874; }
.delivery-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.delivery-meta span { border-radius: 999px; background: #ecebe4; color: #5f716c; padding: 3px 7px; font-size: 8px; font-weight: 750; }
.delivery-appearance { margin: 7px 0 0; color: #6c7d78; font-size: 9px; line-height: 1.4; }
.delivery-data { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 9px; font-size: 11px; color: #5e716b; }
.delivery-data strong { color: var(--ink); }
.inspection { margin: 10px 0 0; font-size: 9px; line-height: 1.45; padding: 9px 10px; border-radius: 8px; background: rgba(46,113,92,.08); color: var(--green); }
.inspection > strong, .inspection > span { display: block; }
.inspection > strong { margin-bottom: 3px; }
.inspection.bad { color: #953d33; background: rgba(218,102,88,.1); }
.analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.analysis-grid span { border: 1px solid rgba(46,113,92,.16); background: rgba(255,255,255,.7); border-radius: 6px; padding: 5px; }
.analysis-grid small, .analysis-grid b { display: block; }
.analysis-grid small { font-size: 7px; color: #71817d; }
.analysis-grid b { font-size: 8px; overflow-wrap: anywhere; }
.delivery-actions { display: flex; align-items: center; gap: 6px; }
.action-button { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; background: #e9e7de; font-size: 10px; }
.action-button:hover { transform: translateY(-1px); }
.action-button.inspect { color: var(--green); }
.action-button.accept { background: var(--green); color: white; }
.action-button.reject { background: #f0dfdb; color: #983d33; }
.delivery.resolved { opacity: .58; }
.delivery.resolved .delivery-actions { display: none; }
.status-tag.accepted { background: rgba(46,113,92,.12); color: var(--green); }
.status-tag.rejected { background: rgba(218,102,88,.1); color: #953d33; }

.operations { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.operation { border: 1px solid var(--line); background: #f9f7f1; border-radius: 12px; padding: 12px; text-align: left; cursor: pointer; display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: start; transition: border .16s ease, transform .16s ease, background .16s ease; }
.operation:hover:not(:disabled) { border-color: rgba(46,113,92,.55); transform: translateY(-2px); background: #fff; }
.operation:disabled { opacity: .43; cursor: not-allowed; }
.operation.done { opacity: .7; background: rgba(216,243,90,.13); }
.operation-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 900; }
.operation strong { display: block; font-size: 11px; margin-bottom: 4px; }
.operation em { display: block; color: var(--green-2); font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.operation small { display: block; color: #6b7b77; font-size: 9px; line-height: 1.35; }
.operation b { display: block; margin-top: 6px; color: var(--green-2); font-size: 9px; }

.right-stack { display: grid; gap: 18px; }
.briefing { background: var(--ink); color: white; }
.briefing .panel-header { border-color: rgba(255,255,255,.13); }
.briefing .panel-header small { color: #a8bbb5; }
.briefing-body { padding: 20px; }
.briefing-number { display: flex; justify-content: space-between; align-items: flex-start; }
.briefing-number strong { font-size: 54px; color: var(--lime); line-height: .9; letter-spacing: -.07em; }
.briefing-number span { font-size: 9px; text-align: right; line-height: 1.5; color: #a9bbb5; text-transform: uppercase; letter-spacing: .1em; }
.briefing p { color: #c9d5d1; line-height: 1.55; font-size: 12px; }
.crew-order { display: flex; gap: 6px; margin-top: 18px; }
.crew-order span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); font-size: 10px; font-weight: 900; border: 1px solid rgba(255,255,255,.13); }
.crew-order span.active { background: var(--lime); color: var(--ink); }
.compliance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 15px; }
.compliance-grid span { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; color: #a9bbb5; font-size: 8px; }
.compliance-grid b { color: white; }

.handover-note { padding: 18px; }
.handover-note textarea { min-height: 100px; resize: vertical; line-height: 1.5; font-size: 12px; }
.handover-note .primary-button { width: 100%; margin-top: 10px; }
.activity-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.activity-list li { font-size: 10px; color: #61736e; line-height: 1.4; padding-left: 12px; position: relative; }
.activity-list li::before { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--lime-dark); left: 0; top: 5px; }

.history-list { padding: 6px 18px 18px; display: grid; }
.history-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-index { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #e9e8df; font-size: 9px; font-weight: 900; }
.history-item h4 { margin: 0; font-size: 11px; }
.history-item p { margin: 4px 0 0; font-size: 9px; color: #6a7c76; line-height: 1.45; }
.history-note { margin-top: 7px; padding: 7px 8px; background: rgba(216,243,90,.14); border-radius: 7px; color: var(--ink); font-style: italic; }
.history-event { color: #a4582c !important; font-weight: 700; }

.handover-dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(9,26,22,.76); backdrop-filter: blur(12px); }
.handover-dialog[hidden] { display: none; }
.handover-card { width: min(480px, 100%); background: var(--paper); border-radius: 24px; padding: clamp(26px, 6vw, 44px); box-shadow: 0 30px 100px rgba(0,0,0,.3); text-align: center; }
.handover-icon { width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: var(--lime); color: var(--ink); font-size: 30px; }
.handover-card > small { font-size: 9px; font-weight: 900; letter-spacing: .2em; color: #698079; }
.handover-card h2 { margin: 8px 0 12px; font-size: 30px; letter-spacing: -.045em; }
.handover-card > p { color: #5e716b; line-height: 1.5; font-size: 13px; }
.event-summary { margin: 18px 0; padding: 13px; border: 1px solid var(--line); background: #fff; border-radius: 12px; text-align: left; }
.event-summary strong { display: block; font-size: 11px; margin-bottom: 4px; }
.event-summary span { display: block; font-size: 10px; color: #657873; line-height: 1.4; }
.handover-share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.handover-share[hidden] { display: none; }
.handover-share button, .handover-share a { min-height: 43px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 850; display: grid; place-items: center; text-decoration: none; }
.share-button { background: #e5e4dc; color: var(--ink); }
.whatsapp-button { background: #25d366; color: #082d1a; }
.handover-share button:hover, .handover-share a:hover { transform: translateY(-1px); filter: brightness(.98); }
.handover-card .primary-button { width: 100%; }

.toast { position: fixed; z-index: 80; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 11px 17px; box-shadow: 0 12px 34px rgba(0,0,0,.24); font-size: 11px; font-weight: 750; max-width: min(90vw, 560px); }
.toast[hidden] { display: none; }

.end-state { min-height: calc(100vh - 136px); display: grid; place-items: center; text-align: center; padding: 40px; }
.end-state-inner { max-width: 650px; }
.end-state .score { font-size: 90px; line-height: 1; color: var(--green-2); letter-spacing: -.08em; font-weight: 850; }
.end-state h1 { font-size: clamp(38px, 6vw, 70px); letter-spacing: -.06em; margin: 16px 0; }
.end-state p { color: #5f726c; line-height: 1.6; }
.end-state .primary-button { width: 240px; margin: 25px auto 0; }
.final-ranking { display: grid; gap: 7px; margin: 22px auto 0; max-width: 520px; text-align: left; }
.final-ranking div { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; }
.final-ranking div > b { grid-row: 1 / 3; color: var(--green-2); }
.final-ranking span { color: #6b7c77; font-size: 9px; }

@media (max-width: 1020px) {
  .landing { grid-template-columns: 1fr; padding-top: 65px; }
  .landing-copy { text-align: center; margin: auto; }
  .landing-copy > p { margin-inline: auto; }
  .feature-list { justify-content: center; }
  .setup-card { width: min(620px, 100%); margin: auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .right-stack { grid-template-columns: repeat(2, 1fr); }
  .history-panel { grid-column: 1 / -1; }
  .situation-strip { grid-template-columns: 1fr 1fr; }
  .scoreboard { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .topbar { height: 66px; padding-inline: 14px; }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 12px; }
  .mode-pill { display: none; }
  .landing { min-height: calc(100vh - 66px); padding: 46px 17px 60px; gap: 45px; }
  .landing h1 { font-size: clamp(44px, 15vw, 68px); }
  .feature-list { display: grid; justify-content: stretch; }
  .game-view { padding: 22px 12px 60px; }
  .game-heading { align-items: flex-start; }
  .game-heading > div { min-width: 0; }
  .game-heading h1 { overflow-wrap: anywhere; }
  .room-code { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .situation-strip { grid-template-columns: 1fr; }
  .scoreboard { grid-column: auto; }
  .stat-card { padding: 12px; }
  .map-panel { min-height: 340px; }
  .map-metrics { grid-template-columns: 1fr; left: 8px; right: 8px; bottom: 8px; }
  .map-metric { padding: 7px 9px; }
  .delivery { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-actions { justify-content: stretch; }
  .action-button { flex: 1; }
  .operations { grid-template-columns: 1fr; }
  .right-stack { grid-template-columns: 1fr; }
  .join-form { grid-template-columns: 1fr; }
  .join-form .secondary-button { grid-column: auto; }
  .lobby-actions { grid-template-columns: 1fr; }
  .panel-header { padding: 14px; }
  .shift-content { padding: 14px; }
}

@media (max-width: 430px) {
  .game-heading h1 { font-size: 28px; line-height: 1.05; }
  .stats-grid { grid-template-columns: 1fr; }
  .waiting-banner { align-items: flex-start; flex-direction: column; }
  .map-panel { min-height: 320px; }
  .cell-label { max-width: 46%; padding: 6px 7px; font-size: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .handover-share { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
