﻿:root {
  --navy: #071c2b;
  --deep: #04121e;
  --panel: #0d2939;
  --gold: #ecc986;
  --cream: #f7edda;
  --muted: #aac0c9;
  --red: #ab493a;
  --aqua: #85d4cd;
  --line: #ffffff20;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 80% 15%, #25647a44, transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 79px, #ffffff03 80px),
    repeating-linear-gradient(90deg, transparent 0 79px, #ffffff03 80px);
  z-index: -1;
}
.sea {
  position: fixed;
  inset: auto 0 0;
  height: 32vh;
  background: repeating-radial-gradient(
    ellipse at 50% 160%,
    transparent 0 38px,
    #6caaa610 40px 42px
  );
  pointer-events: none;
  z-index: -1;
}
header {
  max-width: 1440px;
  margin: auto;
  padding: 24px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  color: var(--cream);
  font-family: Georgia, serif;
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 21px;
  line-height: 1.2;
}
.brand span {
  display: block;
  color: var(--gold);
  font: 10px system-ui;
  letter-spacing: 5px;
  padding-left: 26px;
  margin-top: 5px;
}
.tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
#connection {
  font-size: 12px;
  color: var(--aqua);
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 48px 5% 24px;
  min-height: 75vh;
}
button {
  font: inherit;
  font-weight: 650;
  line-height: 1.35;
  background: transparent;
  color: var(--cream);
  border: 1px solid #dfc79266;
  padding: 13px 20px;
  border-radius: 7px;
  cursor: pointer;
  min-height: 44px;
  transition:
    transform 0.18s,
    background 0.18s;
}
button:hover:not(:disabled) {
  background: #ffffff10;
  transform: translateY(-2px);
}
button.primary {
  background: var(--gold);
  color: #17212a;
  border-color: var(--gold);
}
button.primary:hover:not(:disabled) {
  background: #ffdfa3;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button.quiet {
  border-color: transparent;
  padding: 10px 12px;
  font-size: 13px;
}
.active {
  background: #ecc98622;
  border-color: var(--gold);
}
:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(42px, 5.2vw, 76px);
  line-height: 1.07;
  letter-spacing: -2px;
  margin-bottom: 24px;
}
h2 {
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1.25;
}
em {
  color: var(--gold);
  font-style: italic;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2.7px;
  font-weight: 750;
  color: var(--gold);
  margin-bottom: 22px;
}
.intro {
  color: #c8d8da;
  font-size: 17px;
  line-height: 1.8;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  min-height: 530px;
  gap: 40px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0;
}
.hero-actions button {
  padding: 17px 24px;
}
.hero-actions button span {
  margin-left: 30px;
}
.chips {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}
.route {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 44px;
  color: var(--gold);
  font-size: 12px;
}
.route b {
  color: var(--cream);
  margin-left: 8px;
  font-weight: 500;
}
.route i {
  opacity: 0.3;
}
.hero-art {
  height: 440px;
  position: relative;
  isolation: isolate;
}
.compass {
  position: absolute;
  font: 390px Georgia;
  line-height: 1;
  color: #ecc98615;
  top: -35px;
  left: 0;
  transform: rotate(15deg);
  border: 1px solid #ecc98622;
  border-radius: 50%;
  width: 420px;
  height: 420px;
  text-align: center;
}
.poster {
  position: absolute;
  width: 190px;
  top: 80px;
  filter: drop-shadow(0 20px 20px #0007);
}
.poster .wanted {
  width: 100%;
  cursor: default;
}
.poster .wanted img {
  height: 200px;
}
.p1 {
  left: 0;
  transform: rotate(-15deg);
  z-index: 1;
}
.p2 {
  left: 120px;
  top: 30px;
  transform: rotate(5deg);
  z-index: 3;
}
.p3 {
  left: 240px;
  transform: rotate(17deg);
  z-index: 2;
}
.stamp {
  position: absolute;
  right: 0;
  bottom: 35px;
  z-index: 4;
  color: #edb4a0;
  border: 3px double #d8775c;
  background: #702e27ee;
  padding: 14px 22px;
  transform: rotate(-12deg);
  font-size: 11px;
  text-align: center;
  letter-spacing: 2px;
  border-radius: 50%;
}
.stamp b {
  font-size: 18px;
}
.coordinates {
  position: absolute;
  bottom: -10px;
  left: 85px;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
}
.home-bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 26px;
}
.home-bottom .eyebrow {
  margin-bottom: 8px;
}
.home-bottom h2 {
  font-size: 24px;
}
.home-bottom p {
  font-size: 13px;
  color: var(--muted);
}
footer {
  max-width: 1320px;
  padding: 24px 5%;
  margin: auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0;
}
input,
select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  background: #061924;
  color: var(--cream);
  border: 1px solid #aac0c955;
  border-radius: 6px;
  font: inherit;
  min-height: 46px;
}
input[type="range"] {
  padding: 0;
  accent-color: var(--gold);
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.panel {
  background: linear-gradient(140deg, #123245, #0a2332);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}
.lobby {
  max-width: 1000px;
  margin: 15px auto;
}
.lobby-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-top: 36px;
}
.crew {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.crew-person {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 170px;
}
.crew-person small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.avatar {
  display: grid;
  place-items: center;
  border: 1px solid #ecc98666;
  background: #ecc98612;
  color: var(--gold);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 22px;
  flex-shrink: 0;
}
.empty {
  opacity: 0.7;
}
.lobby .crew {
  flex-direction: column;
  gap: 24px;
}
.invitation {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 22px;
}
.invitation strong {
  display: block;
  font: 36px Georgia;
  letter-spacing: 7px;
  color: var(--gold);
}
.invitation .eyebrow {
  display: block;
  margin-bottom: 4px;
}
.game h1 {
  font-size: 42px;
  margin-bottom: 15px;
}
.game-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.game-heading .eyebrow {
  margin-bottom: 10px;
}
.game > .crew {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.turn-banner {
  margin: 20px 0;
  background: #86d6ce13;
  color: #c9eeea;
  padding: 14px 20px;
  border-left: 3px solid var(--aqua);
  border-radius: 4px;
  font-size: 14px;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
}
.board-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.board-toolbar button {
  font-size: 11px;
  padding: 10px;
}
.board-toolbar span {
  color: var(--muted);
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.wanted {
  background: #edddba;
  color: #2d271d;
  padding: 7px;
  border: 1px solid #b49356;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 9px #0004;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.wanted:hover:not(:disabled) {
  background: #fcebc6;
}
.wanted-label {
  font: bold 21px Georgia;
  letter-spacing: 2px;
}
.wanted img {
  width: 100%;
  height: 135px;
  object-fit: cover;
  border: 1px solid #8f764e;
}
.card-name {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 13px;
  line-height: 1.2;
  min-height: 30px;
  display: grid;
  place-items: center;
}
.card-foot {
  font-size: 7px;
  letter-spacing: 0.7px;
}
.wanted.picked {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
  transform: translateY(-4px);
}
.wanted.discarded {
  filter: grayscale(1);
  opacity: 0.48;
  transform: scale(0.95);
}
.wanted.discarded:after {
  content: "✕";
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  font-size: 54px;
  color: #fff;
  text-shadow: 0 2px 6px #000;
}
.action-panel {
  align-self: start;
  padding: 22px;
  position: sticky;
  top: 16px;
}
.action-panel h2 {
  font-size: 22px;
  margin-top: 24px;
  margin-bottom: 12px;
}
.action-panel button {
  width: 100%;
  margin-top: 10px;
  font-size: 12px;
  padding: 13px;
}
.action-panel strong {
  display: block;
}
.question {
  text-align: left;
  border-color: #ffffff25;
}
.question small {
  display: block;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.secret-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.secret-mini img {
  width: 48px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
}
.secret-mini span {
  font-size: 10px;
  color: var(--muted);
}
.history {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  max-height: 360px;
  overflow: auto;
}
.history li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.history small {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
}
.history b {
  display: inline-block;
  padding: 2px 8px;
  background: #ffffff16;
  border-radius: 4px;
  margin-left: 5px;
}
.result {
  text-align: center;
  max-width: 950px;
  margin: auto;
  animation: arrive 0.5s ease;
}
.result h1 {
  font-size: 54px;
}
.victory-seal {
  font-size: 64px;
  color: var(--gold);
}
.reveal {
  display: flex;
  gap: 36px;
  justify-content: center;
  margin: 30px 0;
}
.reveal > div {
  width: 200px;
}
.reveal p {
  font-size: 12px;
  color: var(--muted);
}
.reveal img {
  height: 170px;
}
.result .hero-actions {
  justify-content: center;
}
.result details {
  max-width: 550px;
  margin: 30px auto;
  text-align: left;
}
summary {
  cursor: pointer;
  min-height: 44px;
}
dialog {
  background: var(--panel);
  color: var(--cream);
  border: 1px solid #ecc98666;
  border-radius: 12px;
  padding: 36px;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 90vh;
  box-shadow: 0 20px 100px #0009;
}
dialog::backdrop {
  background: #020d19bd;
  backdrop-filter: blur(5px);
}
dialog .close {
  position: absolute;
  right: 12px;
  top: 10px;
}
dialog h2 {
  padding-right: 18px;
}
dialog button {
  margin: 8px 8px 0 0;
}
.tutorial {
  padding-left: 20px;
}
.tutorial li {
  margin: 18px 0;
}
.tutorial b {
  display: block;
  color: var(--gold);
}
#form-error {
  color: #ffb5a3;
}
#notice {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: #163e50;
  color: #fff;
  border: 1px solid #82b4ba66;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 12px;
  box-shadow: 0 4px 20px #0005;
  z-index: 10;
  pointer-events: none;
}
#notice:empty {
  display: none;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1250px) {
  .board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .hero {
    gap: 12px;
  }
  .poster {
    width: 150px;
  }
  .poster .wanted img {
    height: 170px;
  }
  .p2 {
    left: 90px;
  }
  .p3 {
    left: 175px;
  }
  .hero-art {
    height: 380px;
  }
  .compass {
    width: 320px;
    height: 320px;
    font-size: 300px;
  }
  .stamp {
    right: -10px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  header {
    padding: 18px 5%;
    align-items: start;
  }
  .brand {
    font-size: 17px;
  }
  .tools {
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .tools button {
    font-size: 11px;
    padding: 8px;
  }
  #connection {
    width: 100%;
    text-align: right;
    font-size: 10px;
  }
  main {
    padding-top: 32px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
  }
  .hero h1 {
    font-size: 52px;
  }
  .intro {
    font-size: 15px;
  }
  .hero-art {
    height: 320px;
    width: 320px;
    max-width: 100%;
    margin: 10px auto;
  }
  .poster {
    width: 140px;
    top: 45px;
  }
  .poster .wanted img {
    height: 145px;
  }
  .p2 {
    left: 85px;
    top: 10px;
  }
  .p3 {
    left: 170px;
  }
  .compass {
    top: -10px;
  }
  .stamp {
    bottom: 12px;
  }
  .coordinates {
    bottom: -7px;
    left: 25px;
  }
  .route {
    margin-top: 24px;
  }
  .hero-actions {
    margin: 24px 0;
  }
  .hero-actions button {
    padding: 15px 17px;
  }
  .home-bottom {
    display: block;
    margin-top: 32px;
  }
  .home-bottom p {
    margin-top: 16px;
  }
  footer {
    flex-direction: column;
    gap: 5px;
    padding-bottom: 70px;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 22px;
  }
  .lobby h1 {
    font-size: 45px;
  }
  .game h1 {
    font-size: 34px;
  }
  .game-layout {
    display: flex;
    flex-direction: column-reverse;
  }
  .action-panel {
    position: static;
    width: 100%;
    padding: 18px;
  }
  .action-panel h2 {
    margin-top: 16px;
  }
  .question {
    display: block;
  }
  .action-panel .history {
    max-height: 140px;
  }
  .board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .wanted img {
    height: 112px;
  }
  .wanted-label {
    font-size: 17px;
  }
  .card-name {
    font-size: 12px;
  }
  .crew {
    gap: 14px;
  }
  .crew-person {
    min-width: 130px;
  }
  .crew-person strong {
    font-size: 12px;
  }
  .avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .turn-banner {
    font-size: 12px;
  }
  .result h1 {
    font-size: 39px;
  }
  .reveal {
    gap: 16px;
  }
  .reveal > div {
    width: 145px;
  }
  .reveal img {
    height: 135px;
  }
  dialog {
    padding: 28px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.mobile-actions-toggle {
  display: none;
}
@media (max-width: 700px) {
  .action-panel.compact {
    padding: 16px;
  }
  .action-panel.compact > .secret-mini {
    margin: 0;
  }
  .action-panel.compact > .eyebrow {
    margin-bottom: 8px;
  }
  .action-panel.compact > h2,
  .action-panel.compact > .muted,
  .action-panel.compact > .question,
  .action-panel.compact > [data-action="suggest"],
  .action-panel.compact > .history {
    display: none;
  }
  .action-panel.compact.expanded > h2,
  .action-panel.compact.expanded > .muted,
  .action-panel.compact.expanded > .question,
  .action-panel.compact.expanded > [data-action="suggest"],
  .action-panel.compact.expanded > .history {
    display: block;
  }
  .mobile-actions-toggle {
    display: block;
  }
  .action-panel.compact.expanded > .question {
    font-size: 12px;
    padding: 10px;
  }
  .action-panel.compact.expanded > .history {
    max-height: 150px;
  }
  .hero-art .wanted {
    pointer-events: none;
  }
}
