@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&display=swap");

:root {
  --ink: #07141c;
  --deep: #091d29;
  --panel: rgba(7, 24, 34, 0.92);
  --panel-soft: rgba(10, 34, 46, 0.84);
  --gold: #d6ad62;
  --gold-light: #f0d493;
  --paper: #eadfc4;
  --muted: #9bafba;
  --blue: #53b8e8;
  --red: #d34c42;
  --green: #4cb788;
  --violet: #8e6ed5;
  --border: rgba(214, 173, 98, 0.42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  color: var(--paper);
  font-family: "Noto Serif SC", "Microsoft YaHei", serif;
  background:
    radial-gradient(circle at 50% -20%, rgba(35, 91, 116, 0.5), transparent 40%),
    linear-gradient(160deg, #031019, #071722 55%, #02090e);
  overflow-x: hidden;
}

button { font: inherit; }
button { transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease; }
button:active:not(:disabled) { transform: translateY(1px); }

.hidden { display: none !important; }
.screen { min-height: 100vh; }

.start-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: url("docs/pics/tiandao.png") center / cover;
  animation: backgroundDrift 18s ease-in-out infinite alternate;
}

.start-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(1, 8, 12, 0.97), rgba(1, 10, 16, 0.78) 48%, rgba(1, 8, 12, 0.93));
}

.start-content {
  position: relative;
  width: min(1180px, 92vw);
  text-align: center;
  padding: 44px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #f4e8c7;
  font-size: 64px;
  letter-spacing: 0.16em;
  text-shadow: 0 4px 28px rgba(214, 173, 98, 0.3);
}

.lead {
  margin: 20px auto 34px;
  max-width: 660px;
  color: #bacad0;
  line-height: 1.8;
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 0 auto 30px;
}

.faction-choice {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--paper);
  cursor: pointer;
  background: #071722;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.faction-choice:hover,
.faction-choice.selected {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(214, 173, 98, 0.15);
}

.faction-choice img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0.8;
  transition: opacity 180ms ease, transform 700ms ease;
}

.faction-choice.selected img { opacity: 1; }
.faction-choice:hover img { transform: scale(1.04); }

.faction-choice div {
  padding: 17px 18px 20px;
  text-align: left;
  background: linear-gradient(to bottom, rgba(7, 23, 34, 0.82), #071722);
}

.faction-choice h3 { margin: 0 0 8px; color: var(--gold-light); font-size: 21px; }
.faction-choice p { margin: 0; color: #a9bbc3; font-size: 13px; line-height: 1.7; }

.primary-btn,
.end-turn-btn {
  padding: 12px 30px;
  border: 1px solid var(--gold);
  color: #08141b;
  cursor: pointer;
  background: linear-gradient(135deg, #e7c77f, #b9893e);
  box-shadow: 0 5px 24px rgba(214, 173, 98, 0.18);
}

.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.start-note { color: #7f99a5; font-size: 12px; }

.game-screen { padding: 18px; }
.game-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 30%, rgba(28, 85, 106, 0.12), transparent 36%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(214,173,98,0.015) 80px);
}

.topbar {
  min-height: 92px;
  display: grid;
  grid-template-columns: 210px 1fr 115px;
  align-items: center;
  gap: 22px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  background: rgba(4, 18, 27, 0.93);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.topbar h2 { margin: 0; color: var(--gold-light); font-size: 22px; font-weight: 600; }
.world-tracks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.track-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  align-items: center;
  color: #a9bac1;
  font-size: 12px;
}

.track-card strong { color: var(--paper); font-size: 15px; }
.bar { grid-column: 1 / -1; height: 5px; overflow: hidden; background: rgba(255,255,255,0.08); }
.bar i { display: block; height: 100%; width: 50%; transition: width 420ms cubic-bezier(.2,.8,.2,1); }
.qi-track i { background: linear-gradient(90deg, #197f75, #54d4b5); }
.magic-track i { background: linear-gradient(90deg, #4d1014, #e94c43); }
.gaze-track i { background: linear-gradient(90deg, #9a6a24, #f4d487); }
.clue-track i { background: linear-gradient(90deg, #42306c, #a989ff); }
.track-card.danger .bar i { animation: dangerPulse 900ms ease-in-out infinite alternate; }
.track-card.track-bump { animation: trackBump 420ms ease; }

.top-actions { display: grid; gap: 7px; }

.ghost-btn {
  padding: 9px 12px;
  border: 1px solid var(--border);
  color: var(--gold-light);
  cursor: pointer;
  background: transparent;
}
.ghost-btn:hover { border-color: var(--gold); background: rgba(214,173,98,0.08); }

.world-alerts {
  display: flex;
  min-height: 27px;
  gap: 7px;
  align-items: center;
  padding: 5px 10px 0;
}
.world-alert {
  padding: 3px 8px;
  border: 1px solid rgba(214,173,98,0.2);
  color: #9db2bb;
  background: rgba(6,22,31,0.8);
  font-size: 10px;
  animation: fadeSlide 260ms ease;
}
.world-alert.danger { border-color: rgba(211,76,66,0.45); color: #e8968e; }
.world-alert.good { border-color: rgba(76,183,136,0.4); color: #8bd6b5; }

.table-layout {
  display: grid;
  grid-template-columns: 306px minmax(620px, 1fr) 300px;
  gap: 16px;
  margin-top: 16px;
}

.left-panel,
.right-panel,
.center-panel { display: flex; flex-direction: column; gap: 16px; }

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}
.panel:hover { border-color: rgba(214, 173, 98, 0.58); }

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(214, 173, 98, 0.22);
  color: var(--gold-light);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.panel-title b { color: #8eabb7; font-size: 11px; font-weight: 400; }
.player-identity { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 14px; }
.player-identity img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--border); }
.player-identity h3 { margin: 3px 0 5px; color: var(--gold-light); }
.player-identity p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(214, 173, 98, 0.12); }
.stat { padding: 9px 12px; background: #081b26; }
.stat span { display: block; color: #839aa4; font-size: 10px; }
.stat strong { color: var(--paper); font-size: 16px; }

.tribulation-box { padding: 12px 14px 14px; }
.section-label { margin: 0 0 8px; color: var(--gold); font-size: 11px; letter-spacing: 0.15em; }
.tribulations { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.tribulations i { height: 7px; background: rgba(255,255,255,0.08); }
.tribulations i.done { background: var(--gold); box-shadow: 0 0 8px rgba(214, 173, 98, 0.45); }
.tribulations i.current { background: #f4e0a5; animation: tribulationGlow 900ms ease-in-out infinite alternate; }

.marker-list,
.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 14px 11px;
}
.marker,
.artifact-chip {
  padding: 3px 7px;
  border: 1px solid rgba(214,173,98,0.2);
  color: #9db4bd;
  background: rgba(255,255,255,0.03);
  font-size: 10px;
}
.marker.hot { border-color: rgba(211,76,66,0.45); color: #e68e86; }
.artifact-chip { color: var(--gold-light); }

.action-panel { padding-bottom: 12px; }
.action-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
.action-btn {
  min-height: 52px;
  padding: 8px;
  border: 1px solid rgba(214, 173, 98, 0.2);
  color: #cad8dd;
  cursor: pointer;
  background: rgba(16, 48, 61, 0.68);
  font-size: 12px;
}
.action-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-light); }
.action-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.action-btn small { color: #8099a3; font-size: 10px; }
.action-btn:hover:not(:disabled) small { color: #b7c8ce; }
.subaction-title {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px 0;
  border-top: 1px solid rgba(214,173,98,0.12);
  color: var(--gold-light);
  font-size: 12px;
}
.subaction-title b { color: #8199a3; font-size: 10px; font-weight: 400; }
.subactions { padding-top: 8px; }
.subactions .action-btn { min-height: 43px; background: rgba(11,39,51,0.6); }
.end-turn-btn { display: block; width: calc(100% - 24px); margin: 0 12px; }
.end-turn-btn:hover:not(:disabled) { filter: brightness(1.08); }

.opponents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opponent {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #071722;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.opponent:hover { transform: translateY(-2px); border-color: rgba(214,173,98,0.6); }
.opponent.targetable { border-color: var(--gold); box-shadow: 0 0 18px rgba(214,173,98,0.16); animation: targetPulse 900ms ease-in-out infinite alternate; }
.opponent.dead { filter: grayscale(1); opacity: 0.55; }
.opponent img { width: 100%; height: 80px; object-fit: cover; object-position: center 20%; opacity: 0.55; }
.opponent.revealed img { opacity: 0.9; }
.opponent-body { padding: 8px 10px 10px; }
.opponent h3 { margin: 0 0 5px; color: var(--gold-light); font-size: 14px; }
.opponent p { margin: 0 0 7px; color: #859da8; font-size: 10px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; color: #bacbd2; font-size: 10px; }
.mini-stats span { padding: 3px; text-align: center; background: rgba(255,255,255,0.04); }
.target-btn {
  width: 100%;
  margin-top: 8px;
  padding: 4px;
  border: 1px solid rgba(214, 173, 98, 0.25);
  color: var(--gold-light);
  cursor: pointer;
  background: transparent;
  font-size: 10px;
}
.target-btn:hover { background: rgba(214,173,98,0.1); }

.world-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.realm-panel,
.contract-panel { min-height: 126px; }
.realm-body { display: grid; grid-template-columns: 52px 1fr; gap: 11px; align-items: center; padding: 12px; }
.realm-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: #87daba;
  box-shadow: inset 0 0 14px rgba(76,183,136,0.15);
}
.realm-body h3 { margin: 0 0 5px; color: var(--gold-light); font-size: 14px; }
.realm-body p { margin: 0; color: #8fa7b0; font-size: 10px; line-height: 1.6; }
.realm-panel.open .realm-seal { animation: realmSpin 5s linear infinite, realmGlow 1s ease-in-out infinite alternate; }
.contracts { display: grid; gap: 5px; padding: 10px 12px; }
.contract-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid rgba(214,173,98,0.12);
  color: #91a8b1;
  font-size: 10px;
}
.contract-row b { color: var(--gold-light); font-weight: 400; }
.empty-note { color: #6f8791; font-size: 10px; line-height: 1.6; }

.event-panel {
  min-height: 118px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 17px;
  align-items: center;
  padding: 16px 22px;
  background:
    linear-gradient(90deg, rgba(6, 26, 37, 0.96), rgba(10, 37, 49, 0.9)),
    url("docs/pics/tiandao.png") center / cover;
  overflow: hidden;
}
.event-panel.event-active { animation: eventReveal 650ms ease; }
.event-symbol {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 28px;
  box-shadow: inset 0 0 18px rgba(214, 173, 98, 0.14);
  animation: symbolFloat 3s ease-in-out infinite;
}
.event-panel h3 { margin: 0 0 6px; color: var(--gold-light); font-size: 19px; }
.event-panel p:last-child { margin: 0; color: #a8bac2; font-size: 12px; line-height: 1.7; }

.hand-panel { min-height: 360px; }
.hand { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 10px; padding: 12px; }
.card {
  position: relative;
  min-height: 205px;
  padding: 12px 10px 42px;
  border: 1px solid rgba(214, 173, 98, 0.42);
  color: #17242a;
  background:
    linear-gradient(rgba(239, 226, 192, 0.96), rgba(218, 200, 160, 0.96)),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(87,65,33,0.04) 8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.card:hover { transform: translateY(-4px); border-color: #c69a4d; box-shadow: 0 10px 22px rgba(0,0,0,0.32); }
.card[data-type="功法"] { border-top: 3px solid #559ec1; }
.card[data-type="法宝"] { border-top: 3px solid #b38b4a; }
.card[data-type="丹药"] { border-top: 3px solid #62a778; }
.card[data-type="因果"] { border-top: 3px solid #a14a47; }
.card[data-type="秘境"] { border-top: 3px solid #7762ae; }
.card h4 { margin: 0 0 8px; color: #263944; font-size: 14px; }
.card-type { color: #805e2f; font-size: 10px; }
.card p { color: #47565b; font-size: 11px; line-height: 1.6; }
.card-cost { position: absolute; top: 9px; right: 9px; color: #2d718a; font-size: 11px; }
.card button {
  position: absolute;
  right: 9px;
  bottom: 9px;
  left: 9px;
  padding: 5px;
  border: 1px solid #9b7d49;
  color: #25353a;
  cursor: pointer;
  background: rgba(255,255,255,0.28);
}
.card button:disabled { opacity: 0.4; cursor: not-allowed; }

.phase-panel { padding-bottom: 14px; }
.phase-panel > p { padding: 0 13px; color: #9db0b8; font-size: 11px; line-height: 1.7; }
.phase-list { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 13px; border-top: 1px solid rgba(214,173,98,0.17); }
.phase-list span { padding-top: 8px; color: #708993; text-align: center; font-size: 10px; }
.phase-list span.active { color: var(--gold-light); text-shadow: 0 0 8px rgba(214,173,98,0.5); }

.objective-panel { padding-bottom: 10px; }
#objective-content { padding: 10px 12px; color: #9db0b8; font-size: 10px; line-height: 1.7; }
.objective-meter { height: 4px; margin-top: 8px; background: rgba(255,255,255,0.06); }
.objective-meter i { display: block; height: 100%; background: var(--gold); transition: width 300ms ease; }

.log-panel { height: 584px; }
.panel-title button { border: 0; color: #8199a3; cursor: pointer; background: transparent; font-size: 10px; }
.log { height: calc(100% - 39px); overflow-y: auto; padding: 10px 12px; }
.log-entry { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #9eb1b9; font-size: 11px; line-height: 1.6; }
.log-entry strong { color: var(--gold-light); font-weight: 600; }
.log-entry.fresh { animation: logFresh 450ms ease; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.72);
}
.modal-card {
  position: relative;
  width: min(620px, 90vw);
  max-height: 84vh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--gold);
  color: #c6d4d9;
  background: #071923;
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
}
.modal-card h2 { margin-top: 0; color: var(--gold-light); }
.modal-card h3 { color: var(--gold); font-size: 15px; }
.modal-card p, .modal-card li { font-size: 13px; line-height: 1.8; }
.modal-close { position: absolute; top: 8px; right: 12px; border: 0; color: var(--gold); cursor: pointer; background: transparent; font-size: 24px; }
.choice-list { display: grid; gap: 8px; margin-top: 16px; }
.choice-list button { padding: 10px; border: 1px solid var(--border); color: var(--paper); cursor: pointer; background: #0b2835; }
.choice-list button:hover { border-color: var(--gold); color: var(--gold-light); background: #103443; }

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.float-text {
  position: fixed;
  z-index: 42;
  color: #f5dda0;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 2px 6px #000;
  animation: floatUp 1.2s ease-out forwards;
}
.float-text.damage { color: #ff8277; }
.float-text.heal { color: #82e0b5; }
.float-text.magic { color: #c890ff; }
.screen-flash {
  position: fixed;
  inset: 0;
  animation: screenFlash 480ms ease-out forwards;
}
.screen-flash.red { background: rgba(211,76,66,0.18); }
.screen-flash.gold { background: rgba(214,173,98,0.18); }
.screen-flash.violet { background: rgba(142,110,213,0.18); }
.particle {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f2d58b;
  box-shadow: 0 0 8px currentColor;
  animation: particleBurst 900ms ease-out forwards;
}
.turn-banner {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(7,28,39,0.38), transparent 46%);
}
.turn-banner span {
  padding: 12px 50px;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  color: var(--gold-light);
  background: rgba(5,21,30,0.9);
  font-size: 24px;
  letter-spacing: 0.18em;
  animation: bannerIn 1.1s ease forwards;
}

@keyframes backgroundDrift { from { background-position: 48% 50%; } to { background-position: 52% 48%; } }
@keyframes dangerPulse { from { filter: brightness(0.8); } to { filter: brightness(1.45); box-shadow: 0 0 10px currentColor; } }
@keyframes trackBump { 50% { transform: scale(1.025); } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes tribulationGlow { from { box-shadow: 0 0 4px rgba(244,224,165,0.3); } to { box-shadow: 0 0 14px rgba(244,224,165,0.9); } }
@keyframes targetPulse { from { box-shadow: 0 0 8px rgba(214,173,98,0.12); } to { box-shadow: 0 0 24px rgba(214,173,98,0.35); } }
@keyframes realmSpin { to { transform: rotate(360deg); } }
@keyframes realmGlow { to { box-shadow: inset 0 0 20px rgba(76,183,136,0.4), 0 0 14px rgba(76,183,136,0.25); } }
@keyframes eventReveal { 0% { transform: scale(0.985); filter: brightness(1.8); } 100% { transform: none; filter: none; } }
@keyframes symbolFloat { 50% { transform: translateY(-3px); } }
@keyframes logFresh { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(10px) scale(0.8); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-55px) scale(1.08); } }
@keyframes screenFlash { from { opacity: 1; } to { opacity: 0; } }
@keyframes particleBurst { to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); } }
@keyframes bannerIn { 0% { opacity: 0; transform: scaleX(0.5); } 25% { opacity: 1; transform: scaleX(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

@media (max-width: 1280px) {
  body { min-width: 1160px; }
  .table-layout { grid-template-columns: 286px minmax(560px, 1fr) 270px; }
  .hand { grid-template-columns: repeat(4, minmax(95px, 1fr)); }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
    font-size: 14px;
  }

  .screen { min-height: 100dvh; }
  .start-screen { display: block; overflow: auto; }
  .start-content { width: 100%; padding: 32px 14px 48px; }
  h1 { font-size: 34px; letter-spacing: 0.08em; }
  .lead { margin: 14px auto 22px; font-size: 13px; }
  .faction-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .faction-choice { min-height: 260px; }
  .faction-choice img { height: 130px; }
  .faction-choice div { padding: 11px 12px 14px; }
  .faction-choice h3 { font-size: 17px; }
  .faction-choice p { font-size: 11px; line-height: 1.55; }
  .primary-btn { width: 100%; }

  .game-screen { padding: 7px; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 9px;
  }
  .topbar h2 { font-size: 16px; }
  .topbar .eyebrow { font-size: 10px; }
  .world-tracks {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
  }
  .track-card { font-size: 10px; }
  .track-card strong { font-size: 12px; }
  .top-actions { grid-column: 2; grid-row: 1; grid-template-columns: 1fr 1fr; }
  .ghost-btn { padding: 5px 7px; font-size: 10px; }
  .world-alerts {
    min-height: 0;
    overflow-x: auto;
    padding: 5px 0 0;
    white-space: nowrap;
  }

  .table-layout {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 8px;
  }
  .center-panel { order: 1; gap: 9px; }
  .left-panel { order: 2; gap: 9px; }
  .right-panel { order: 3; gap: 9px; }

  .opponents { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .opponent { min-height: 150px; }
  .opponent img { height: 58px; }
  .opponent-body { padding: 6px; }
  .opponent h3 { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .opponent p { font-size: 8px; min-height: 24px; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); gap: 2px; font-size: 8px; }
  .target-btn { font-size: 9px; }

  .world-stage { grid-template-columns: 1fr; gap: 7px; }
  .realm-panel,
  .contract-panel { min-height: 0; }
  .realm-body { padding: 9px; }
  .event-panel {
    min-height: 104px;
    grid-template-columns: 52px 1fr;
    gap: 10px;
    padding: 11px;
  }
  .event-symbol { width: 44px; height: 44px; font-size: 20px; }
  .event-panel h3 { font-size: 15px; }
  .event-panel p:last-child { font-size: 10px; line-height: 1.55; }

  .hand-panel { min-height: 0; }
  .hand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }
  .card { min-height: 180px; padding: 10px 8px 38px; }
  .card h4 { font-size: 13px; }
  .card p { font-size: 10px; line-height: 1.5; }
  .card-type,
  .card-cost { font-size: 9px; }

  .player-identity { grid-template-columns: 60px 1fr; padding: 10px; }
  .player-identity img { width: 60px; height: 60px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 7px 8px; }
  .stat strong { font-size: 13px; }
  .action-buttons { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px; }
  .action-btn { min-height: 48px; padding: 6px; font-size: 11px; }
  .subactions .action-btn { min-height: 40px; }

  .phase-panel,
  .objective-panel { display: none; }
  .log-panel { height: 320px; }
  .modal-card { width: calc(100vw - 20px); max-height: 86dvh; padding: 22px 16px; }
  .turn-banner span { padding: 9px 24px; font-size: 18px; }
}
