:root {
  --abyss: #07141c;
  --abyss-2: #102833;
  --ink: #1b1712;
  --parchment: #f3ead8;
  --parchment-2: #e6d5b8;
  --gold: #e2b15a;
  --gold-2: #8c6730;
  --sea: #1f7a78;
  --foam: #d7efe8;
  --coral: #d4654f;
  --line: rgba(243, 234, 216, 0.16);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Times New Roman", serif;
  --sans: Manrope, "Segoe UI", "Noto Sans", sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  background: var(--abyss);
}
button, input { font: inherit; color: inherit; }
button, [role="button"] { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; display: block; }

.gate {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(7, 20, 28, 0.55), rgba(7, 20, 28, 0.82)),
    url("/static/img/bg.jpg") center/cover no-repeat,
    radial-gradient(900px 420px at 70% 0%, rgba(226, 177, 90, 0.16), transparent 55%),
    var(--abyss);
}
.gate-wrap { width: min(440px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 64px; }
.gate-wrap.wide { width: min(1040px, calc(100% - 28px)); }
.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  margin: 0 0 12px;
}
h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; font-weight: 600; }
.lede { margin: 0 0 22px; color: var(--foam); max-width: 62ch; }
.panel {
  background: rgba(16, 28, 36, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
label, legend { display: block; margin: 12px 0 6px; color: var(--parchment-2); font-size: 14px; }
fieldset { border: 0; margin: 0; padding: 0; }
input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 20, 28, 0.65);
  padding: 0 12px;
}
.primary, .ghost, .tiny {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0 16px;
}
.primary { background: var(--gold); color: var(--ink); font-weight: 700; width: 100%; margin-top: 14px; }
.ghost { background: transparent; border-color: var(--line); width: 100%; margin-top: 10px; }
.tiny { min-height: 40px; background: transparent; border-color: var(--line); padding: 0 10px; }
.primary:hover, .ghost:hover, .tiny:hover { filter: brightness(1.06); }
.error { color: #ffc7bc; margin: 8px 0 0; }
.choice { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.stack { display: grid; gap: 16px; }
.diffs { display: flex; flex-wrap: wrap; gap: 8px; }
.diff { position: relative; margin: 0; }
.diff input { position: absolute; opacity: 0; pointer-events: none; }
.diff span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line); font-size: 14px;
}
.diff input:checked + span { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.diff input:focus-visible + span { outline: 2px solid var(--gold); }
.names { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.rules { margin-top: 22px; }
.rules summary { cursor: pointer; color: var(--gold); font-size: 18px; font-family: var(--serif); }
.rules ol { padding-left: 18px; }
.rules li { margin: 8px 0; }
.quiet { color: #c9d7d4; margin-top: 0; }
.foot { color: #8ea09c; font-size: 13px; }

.person-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; margin: 0 0 8px; padding: 6px 16px 6px 8px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(16, 28, 36, 0.9); color: var(--parchment);
}
.faces-preview { display: flex; }
.faces-preview img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid #102028; margin-left: -10px; background: #14343a;
}
.faces-preview img:first-child { margin-left: 0; }
.cast {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 16px;
  background: rgba(4, 10, 14, 0.78);
}
.cast[hidden] { display: none; }
.cast-card {
  width: min(980px, 100%);
  max-height: min(880px, calc(100vh - 32px));
  overflow: auto;
  background: rgba(12, 24, 32, 0.97);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 22px;
  box-shadow: var(--shadow);
}
.cast-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cast-head h2 { margin: 0; }
.cast-head .tiny { width: auto; margin: 0; }
.role-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.role-block h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.role-block p { margin: 0 0 10px; color: #c9d7d4; }
.face-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.face-row button {
  background: rgba(7, 20, 28, 0.55);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 8px 8px 10px;
  color: var(--parchment-2);
}
.face-row button.picked { border-color: var(--gold); background: rgba(226, 177, 90, 0.14); }
.face-row img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #14343a; }
.face-row span { display: block; margin-top: 6px; font-size: 13px; text-align: center; }

.app { min-height: 100vh; padding: 12px 14px 28px; }
.topbar, .relics, .stage, .hands { width: min(1180px, 100%); margin: 0 auto; }
.topbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-family: var(--serif); font-size: 28px; line-height: 1; }
.brand span, .codechip { color: var(--gold); letter-spacing: 0.08em; font-size: 13px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.meter { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
.notch {
  min-width: 42px; height: 52px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(16, 40, 51, 0.8);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: var(--foam);
}
.notch b { font-family: var(--serif); font-size: 18px; }
.notch small { font-size: 9px; letter-spacing: 0; text-align: center; line-height: 1.1; max-width: 54px; }
.notch.on { background: var(--gold); color: var(--ink); transform: translateY(-3px); }
.notch.skull { color: var(--coral); }
.notch.past { opacity: 0.55; }

.relics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px auto; }
.relic {
  display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: center;
  background: rgba(16, 28, 36, 0.72); border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  min-height: 74px;
}
.relic.off { opacity: 0.55; }
.relic.on { border-color: rgba(226, 177, 90, 0.7); }
.relic img, .relic .ph {
  width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #14343a;
}
.relic .name { font-family: var(--serif); font-size: 16px; line-height: 1.1; }
.sites { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.sites i { font-style: normal; font-size: 11px; color: #b7c7c3; }
.sites i.flood { color: #8ecbff; }
.sites i.sunk { color: var(--coral); text-decoration: line-through; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.ocean {
  background:
    linear-gradient(180deg, rgba(8, 30, 40, 0.25), rgba(5, 16, 24, 0.55)),
    url("/static/img/bg.jpg") center/cover;
  border-radius: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  min-height: 280px;
}
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(4px, 0.7vw, 9px); }
.cell { aspect-ratio: 1; position: relative; }
.cell.ghost { pointer-events: none; }
.tile {
  width: 100%; height: 100%; padding: 0; border: 0; border-radius: 16%;
  position: relative; overflow: hidden; background: #16343c center/cover;
  box-shadow: inset 0 0 0 1px rgba(243, 234, 216, 0.28), 0 6px 14px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}
.tile img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 14px 3px 3px; font-size: clamp(8px, 1.05vw, 11px); line-height: 1.15;
  background: linear-gradient(transparent, rgba(6, 14, 18, 0.92));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mark {
  position: absolute; top: 4px; left: 4px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; border: 2px solid #f3ead8;
  background: #111; box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.cell.exit .tile { box-shadow: inset 0 0 0 3px var(--gold), 0 6px 14px rgba(0,0,0,.28); }
.cell.tr-granite .tile { box-shadow: inset 0 0 0 3px #e23b4a, 0 6px 14px rgba(0,0,0,.28); }
.cell.tr-storm .tile { box-shadow: inset 0 0 0 3px #f0c14a, 0 6px 14px rgba(0,0,0,.28); }
.cell.tr-forge .tile { box-shadow: inset 0 0 0 3px #e07a32, 0 6px 14px rgba(0,0,0,.28); }
.cell.tr-pearl .tile { box-shadow: inset 0 0 0 3px #4aa3e8, 0 6px 14px rgba(0,0,0,.28); }
.cell.flooded .tile img.art {
  filter: grayscale(1) contrast(0.95) brightness(0.78);
}
.cell.flooded .tile::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(236, 236, 236, 0.2), rgba(20, 20, 20, 0.55));
  mix-blend-mode: multiply;
}
.cell.hot .tile { box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 3px rgba(226, 177, 90, 0.35); }
.cell.picked .tile { box-shadow: inset 0 0 0 3px var(--foam); }
.whirl {
  width: 70%; height: 70%; margin: 15%; border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 220, 220, 0.35), rgba(0, 0, 0, 0.15) 42%, transparent 70%);
  border: 1px dashed rgba(215, 239, 232, 0.25);
}
.pawns { position: absolute; right: 2px; top: 2px; z-index: 3; display: flex; flex-direction: column; gap: 3px; }
.pawn {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--c, white);
  overflow: visible; background: var(--c); color: #111; font-size: 18px; font-weight: 800;
  display: grid; place-items: center; padding: 0;
}
.pawn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.pawn.me { outline: 2px solid white; }
.pawn.onturn::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 40%, var(--c, #f3ead8) 70%, #fff 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 3px));
  animation: halo 1.15s linear infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 8px var(--c, #fff));
}
@keyframes halo { to { transform: rotate(360deg); } }

.dock {
  background: rgba(16, 28, 36, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.who { display: flex; gap: 8px; align-items: center; }
.who img, .who .ph { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c); background: #14343a; }
.who .nm { font-family: var(--serif); font-size: 20px; line-height: 1; }
.pips { display: flex; gap: 5px; }
.pip { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--gold); }
.pip.on { background: var(--gold); }
.actions button { max-width: 100%; white-space: normal; text-align: center; }
.actions button, .dock .primary { width: auto; margin: 0; min-height: 44px; }
.hint { margin: 0; color: var(--foam); font-size: 14px; }
.log { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; }
.log li { font-size: 13px; color: #d5e4e0; border-top: 1px solid var(--line); padding: 5px 0; }
.chat { display: flex; gap: 6px; }
.chat input { min-height: 40px; }
.chat button { width: auto; margin: 0; min-height: 40px; }
.thread { list-style: none; margin: 8px 0; padding: 0; max-height: 140px; overflow: auto; }
.thread li { font-size: 13px; line-height: 1.35; margin: 2px 0; }
.thread .from-admin,
.thread .from-admin b { color: #ff4d4d; font-weight: 700; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 12px; }
.roster { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.roster a { display: flex; gap: 8px; align-items: center; color: inherit; text-decoration: none; padding: 6px 0; border-top: 1px solid var(--line); }
.roster img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.roster small { display: block; color: #c9d7d4; }
.admin-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.admin-tools form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.admin-tools input { min-height: 40px; }
.admin-tools button { width: auto; margin: 0; }
.table-admin { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.hands { margin-top: 12px; display: grid; gap: 8px; }
.hand {
  display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center;
  background: rgba(16, 28, 36, 0.78); border: 1px solid var(--line); border-radius: 16px; padding: 8px;
}
.hand.now { border-color: rgba(226, 177, 90, 0.85); }
.identity { display: flex; gap: 8px; align-items: center; }
.identity img, .identity .ph { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #14343a; }
.cards { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.card {
  width: 86px; flex: 0 0 auto; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: #102028; padding: 0; text-align: left;
}
.card .pic { height: 58px; background: #1a3c44 center/cover; position: relative; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .lbl { display: block; padding: 4px 6px 6px; font-size: 11px; line-height: 1.2; min-height: 32px; }
.card .ops { display: flex; flex-direction: column; }
.card .ops button { border: 0; border-top: 1px solid var(--line); background: transparent; min-height: 32px; font-size: 12px; }
.give-to { margin-top: 4px; }

.banner {
  margin: 8px auto; width: min(1180px, 100%);
  background: rgba(212, 101, 79, 0.15); border: 1px solid rgba(212, 101, 79, 0.45);
  border-radius: 12px; padding: 10px 12px;
}
.overlay {
  position: fixed; inset: 0; background: rgba(4, 10, 14, 0.72);
  display: grid; place-items: center; padding: 18px; z-index: 15;
}
.overlay .panel { width: min(460px, 100%); text-align: center; }
.modal {
  position: fixed; inset: 0; background: rgba(4, 10, 14, 0.72);
  display: grid; place-items: center; z-index: 16; padding: 18px;
}
.sheet { width: min(560px, 100%); max-height: min(80vh, 720px); overflow: auto; }
.sheet ul { padding-left: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: #2a1614; color: var(--parchment); border: 1px solid var(--coral);
  border-radius: 999px; padding: 10px 16px; z-index: 30; max-width: calc(100% - 24px);
}

.hardcard { display: block; margin: 12px 0 0; position: relative; cursor: pointer; }
.hardcard input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.hardcard > span {
  display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center;
  padding: 8px; border-radius: 16px; border: 1px solid var(--line); text-align: left;
  background: rgba(8, 24, 34, 0.45);
}
.hardcard img { width: 74px; height: 98px; object-fit: cover; border-radius: 10px; }
.hardcard strong { display: block; font-family: var(--serif); font-size: 20px; }
.hardcard em { font-style: normal; color: #c9d7d4; font-size: 13px; line-height: 1.35; }
.hardcard input:checked + span { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.hardcard input:focus-visible + span { outline: 2px solid var(--gold); }

.vn {
  position: fixed; inset: 0; z-index: 24;
  background: rgba(3, 8, 12, 0.84);
  display: grid; place-items: center; padding: 14px;
}
.vn-card {
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #101c24;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.vn-card img.scene { width: 100%; max-height: 46vh; aspect-ratio: 16/9; object-fit: cover; display: block; background: #0c2430; }
.vn-card img.bluewash { filter: grayscale(1) contrast(1.05) brightness(0.7); }
.vn-card img.sinkwash { filter: grayscale(1) contrast(1.8) brightness(0.05); }
.vn-body { padding: 14px 18px 18px; }
.vn-body h2 { font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); margin: 2px 0 8px; line-height: 1.05; }
.vn-body p { margin: 0 0 10px; }
.vn .primary { margin-top: 8px; }
.linkbtn { display: grid; place-items: center; text-decoration: none; margin-top: 10px; }
.loot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 12px; }
.showcard {
  width: 132px; margin: 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #0d1c24;
}
.showcard img { width: 100%; height: 156px; object-fit: cover; display: block; background: #14343c; }
.showcard.blue img { filter: grayscale(1) contrast(1.05) brightness(0.68); }
.showcard.sink img { filter: grayscale(1) contrast(1.8) brightness(0.05); }
.showcard b { display: block; padding: 8px 6px 10px; font-size: 12px; text-align: center; font-weight: 650; }
.roles-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0 12px; }
.roles-row article { width: 116px; text-align: center; }
.roleface { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: block; margin: 0 auto 6px; border: 3px solid var(--gold); background: #14343a; }
.roleface img { width: 100%; height: 100%; object-fit: cover; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(243, 234, 216, 0.28); display: block; }
.dots i.on { background: var(--gold); }

@media (max-width: 900px) {
  .app { display: flex; flex-direction: column; }
  .topbar { order: 0; }
  .stage { order: 1; }
  .relics { order: 2; }
  .hands { order: 3; }
  .choice, .stage, .hand { grid-template-columns: 1fr; }
  .relics { grid-template-columns: 1fr 1fr; }
  .hand { grid-template-columns: 1fr; }
  h1 { font-size: 42px; }
  .ocean { padding: 8px; }
  .pawn { width: 52px; height: 52px; }
  .face-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .notch { min-width: 34px; height: 44px; }
  .notch b { font-size: 15px; }
  .brand strong { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .notch.on { transform: none; }
}

.sitenav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.sitenav form { margin: 0; }
.sitenav .tiny, .tabs .tiny { width: auto; margin: 0; text-decoration: none; display: inline-grid; place-items: center; }
.whochip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(16, 28, 36, 0.9);
  color: inherit; text-decoration: none;
}
.whochip img, .friend img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #14343a;
}
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head h1 { margin: 0; }
.avatar-open {
  width: 72px; height: 72px; padding: 0; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--gold); background: #14343a; cursor: pointer;
}
.avatar-open img, .profile-head img, .friend img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #14343a; display: block;
}
.friend img { width: 36px; height: 36px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs .tiny.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.avatar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-height: 420px; overflow: auto; margin-top: 8px; }
.avatar-pick { position: relative; margin: 0; cursor: pointer; }
.avatar-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.avatar-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 2px solid transparent; background: #14343a; }
.avatar-pick span { display: block; font-size: 11px; text-align: center; margin-top: 4px; color: #c9d7d4; }
.avatar-pick input:checked + img { border-color: var(--gold); }
.avatar-pick input:focus-visible + img { outline: 2px solid var(--gold); }
.statlist { list-style: none; padding: 0; margin: 0 0 12px; }
.statlist li { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 6px 0; }
.friend { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.friend form { display: flex; gap: 6px; margin-left: auto; }
.role-stats { display: grid; gap: 8px; }
.role-stats article { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: center; }
.role-stats img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; }
.role-stats span { display: block; color: #c9d7d4; font-size: 13px; }
.shop-block { margin-top: 12px; }
.shop-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-card { display: flex; flex-direction: column; gap: 6px; }
.shop-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #14343a; }
.shop-card span, .shop-card em { color: #c9d7d4; font-size: 14px; }
.shop-card .primary { margin-top: 4px; }
a { color: var(--gold); }

.table-body { height: 100vh; overflow: hidden; }
.table-body .app {
  height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  padding: 8px 10px 10px; box-sizing: border-box;
}
.table-body .topbar, .table-body .relics { flex: none; width: min(1280px, 100%); }
.table-body .relics { margin: 8px auto; }
.play {
  flex: 1; min-height: 0; width: min(1280px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 232px minmax(0, 1fr) 270px; gap: 10px; align-items: stretch;
}
.table-body .hands { margin: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.table-body .hand { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.table-body .cards { flex-wrap: wrap; }
.table-body .card { width: 76px; }
.table-body .ocean { height: 100%; min-height: 0; overflow: auto; }
.table-body .dock { min-height: 0; overflow: auto; }

@media (max-width: 980px) {
  .table-body, .table-body .app { height: auto; overflow: auto; }
  .play { grid-template-columns: 1fr; }
  .table-body .ocean { height: auto; }
  .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-row { grid-template-columns: 1fr; }
}
