:root {
  color-scheme: dark;
  --gold: #f2c665;
  --blue: #72c7ff;
  --red: #ff6544;
  --panel: rgba(5, 8, 12, 0.76);
  --line: rgba(242, 198, 101, 0.48);
  --line-blue: rgba(114, 199, 255, 0.48);
  --text: #fff4d2;
  --muted: #aeb8bd;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #05070a;
  color: var(--text);
  font-family:
    "Microsoft JhengHei",
    "Noto Sans TC",
    system-ui,
    sans-serif;
  overflow: hidden;
}

button {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.app {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(51, 66, 77, 0.34), transparent 52%),
    linear-gradient(180deg, #07090d, #020304);
}

.home-screen,
.meta-panel {
  width: min(100vw, 177.79vh);
  height: min(56.25vw, 100vh);
  min-height: min(100vh, 620px);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 7, 10, 0.94), rgba(4, 7, 10, 0.68) 48%, rgba(4, 7, 10, 0.9)),
    url("assets/battlefield/four-source-battlefield-playmat-v1.png") center / cover;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.72);
}

.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 23%);
  grid-template-rows: 1fr auto;
  gap: 3vh 3.5vw;
  align-items: center;
  padding: clamp(28px, 5vw, 76px);
}

.home-copy {
  grid-column: 1;
  max-width: 620px;
}

.home-logo-title {
  margin: -1.4vh 0 1.6vh;
  width: min(61vw, 920px);
  max-width: 100%;
}

.home-logo-title img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.56));
}

.home-logo-title span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-copy p {
  margin: 0;
  max-width: 38em;
  color: #dce7e9;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  line-height: 1.75;
}

.profile-strip {
  position: absolute;
  top: clamp(18px, 2.4vw, 36px);
  right: clamp(18px, 2.8vw, 48px);
  display: flex;
  gap: 0.75vw;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(242, 198, 101, 0.36);
  border-radius: 0.8rem;
  background: rgba(3, 7, 11, 0.72);
  backdrop-filter: blur(8px);
}

.profile-strip span {
  color: #bfcbd0;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
}

.profile-strip strong {
  color: #fff1c2;
}

.home-actions {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.82rem;
  align-self: center;
  width: min(230px, 100%);
}

.home-actions button,
.meta-header button,
.stage-card button,
.pack-view button {
  min-height: 48px;
  border: 1px solid rgba(242, 198, 101, 0.46);
  border-radius: 0.65rem;
  color: var(--text);
  background: rgba(11, 16, 21, 0.84);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.home-actions button:first-child {
  border-color: rgba(255, 214, 105, 0.78);
  background: linear-gradient(180deg, rgba(91, 66, 23, 0.95), rgba(29, 23, 15, 0.95));
  font-weight: 700;
}

.home-actions button:hover,
.meta-header button:hover,
.stage-card button:hover,
.pack-view button:hover {
  border-color: rgba(255, 221, 126, 0.9);
  background: rgba(38, 32, 20, 0.92);
}

.stage-card button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  border-color: rgba(174, 184, 189, 0.22);
  background: rgba(9, 13, 17, 0.62);
  box-shadow: none;
}

.home-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  color: rgba(255, 244, 210, 0.62);
  border-color: rgba(174, 184, 189, 0.22);
  background: rgba(9, 13, 17, 0.62);
  box-shadow: none;
}

.home-actions button:disabled:hover {
  border-color: rgba(174, 184, 189, 0.22);
  background: rgba(9, 13, 17, 0.62);
}

.meta-panel {
  padding: clamp(20px, 3.2vw, 48px);
}

.meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 2vh;
}

.meta-header h2 {
  margin: 0.3rem 0 0;
  color: #fff4d0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.meta-header button {
  min-width: 128px;
  padding: 0 1rem;
}

.meta-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-height: calc(100% - 96px);
  overflow: auto;
  padding-right: 0.4rem;
}

.stage-card,
.collection-card,
.pack-view {
  border: 1px solid rgba(242, 198, 101, 0.26);
  border-radius: 0.8rem;
  background: rgba(4, 8, 13, 0.78);
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.stage-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.tag {
  width: fit-content;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(114, 199, 255, 0.4);
  border-radius: 999px;
  color: #9ee0ff;
  font-size: 0.78rem;
}

.stage-card h3 {
  margin: 0;
  color: #fff4d0;
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
}

.stage-card p,
.stage-card small,
.pack-view p,
.collection-card p,
.empty-state {
  margin: 0;
  color: #c6d2d7;
  line-height: 1.55;
}

.stage-card small {
  color: #f2c665;
}

.collection-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.collection-card {
  min-height: 96px;
  border-color: rgba(114, 199, 255, 0.22);
}

.collection-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  color: #fff4d0;
}

.collection-card span {
  color: #f2c665;
}

.pack-view {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
}

.pack-view button {
  width: fit-content;
  min-width: 180px;
  padding: 0 1.2rem;
}

.table {
  position: relative;
  width: min(76vw, 132vh);
  height: min(42.75vw, 74.25vh);
  margin-top: -7vh;
  overflow: visible;
  background: #080b0f;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.72);
  transform: translateX(-8.5vw);
}

.battlefield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.zone {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 1.2vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55vw;
  padding: 0.7vh 0.75vw;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.zone::before {
  content: attr(aria-label);
  position: absolute;
  top: 0.45vh;
  left: 0.65vw;
  color: rgba(231, 233, 220, 0.26);
  font-size: clamp(0.55rem, 0.8vw, 0.82rem);
  letter-spacing: 0;
  pointer-events: none;
}

.zone.is-legal {
  background: rgba(255, 210, 92, 0.08);
  border-color: rgba(255, 214, 105, 0.62);
  box-shadow: inset 0 0 26px rgba(255, 184, 59, 0.15);
}

.zone.is-hovered {
  background: rgba(114, 199, 255, 0.14);
  border-color: rgba(126, 216, 255, 0.9);
  box-shadow:
    inset 0 0 32px rgba(83, 185, 255, 0.22),
    0 0 24px rgba(83, 185, 255, 0.2);
}

.opponent-buildings {
  left: 75.5%;
  top: 18%;
  width: 9.5%;
  height: 24%;
}

.opponent-rear {
  left: 24%;
  top: 7.5%;
  width: 50%;
  height: 16%;
}

.opponent-front {
  left: 24%;
  top: 26%;
  width: 50%;
  height: 15%;
}

.player-front {
  left: 24%;
  top: 55.5%;
  width: 50%;
  height: 15%;
}

.player-rear {
  left: 24%;
  top: 73%;
  width: 50%;
  height: 16%;
}

.player-buildings {
  left: 13.5%;
  top: 58%;
  width: 9.5%;
  height: 24%;
}

.status {
  position: absolute;
  width: 15.5%;
  height: 6.6%;
  border: 1px solid rgba(242, 198, 101, 0.72);
  border-radius: 1.1vh;
  background: rgba(2, 5, 8, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65vw;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
  z-index: 6;
}

.status-opponent {
  top: 1.2%;
  right: 1.2%;
}

.status-player {
  left: 1.2%;
  bottom: 1.2%;
}

.status-name {
  color: var(--muted);
  font-size: clamp(0.7rem, 0.95vw, 0.95rem);
}

.status strong {
  color: #fff7d6;
  font-size: clamp(1.1rem, 2.2vw, 2rem);
  line-height: 1;
}

.resource-panel {
  position: absolute;
  left: 2.6%;
  width: 10.8%;
  display: grid;
  gap: 0.7vh;
}

.resources-opponent {
  top: 11%;
}

.resources-player {
  top: 61%;
}

.resource {
  min-height: 5.6vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35vw;
  padding: 0.25vh 0.3vw;
  border: 1px solid rgba(239, 208, 130, 0.18);
  border-radius: 1vh;
  background: rgba(5, 8, 12, 0.42);
  backdrop-filter: blur(4px);
}

.resource.is-undeveloped {
  filter: grayscale(0.65);
  opacity: 0.58;
}

.resource img {
  width: clamp(26px, 2.55vw, 48px);
  height: clamp(26px, 2.55vw, 48px);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.52);
  flex: 0 0 auto;
}

.resource-stats {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
  color: #fff3c7;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.82);
}

.resource-stats strong {
  font-size: clamp(0.62rem, 0.85vw, 0.9rem);
  white-space: nowrap;
}

.resource-stats small {
  font-size: clamp(0.78rem, 1.1vw, 1.1rem);
  font-weight: 800;
  color: #ffffff;
}

.phase-bar {
  position: absolute;
  left: calc(100% + 1.2vw);
  top: 13.5%;
  width: clamp(210px, 19vw, 290px);
  min-height: 7.2rem;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.85rem 0.8rem;
  border-radius: 1.4vh;
  background: rgba(2, 4, 7, 0.72);
  border: 1px solid rgba(229, 203, 136, 0.36);
  backdrop-filter: blur(6px);
}

.action-panel {
  position: absolute;
  left: calc(100% + 1.2vw);
  top: calc(13.5% + 8.4rem);
  width: clamp(190px, 18vw, 270px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.45rem;
  padding: 0.8rem 0.75rem;
  border: 1px solid rgba(242, 198, 101, 0.34);
  border-radius: 1.1vh;
  background: rgba(3, 7, 11, 0.78);
  backdrop-filter: blur(6px);
}

.action-panel label {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.55vw;
  color: #d8e2e5;
  font-size: clamp(0.62rem, 0.84vw, 0.84rem);
}

.action-panel select,
.action-panel button {
  min-height: 3.2vh;
  border: 1px solid rgba(242, 198, 101, 0.36);
  border-radius: 0.65vh;
  color: var(--text);
  background: rgba(13, 17, 21, 0.86);
}

.action-panel button {
  cursor: pointer;
}

.action-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  color: rgba(255, 244, 210, 0.58);
  border-color: rgba(174, 184, 189, 0.22);
  background: rgba(9, 13, 17, 0.62);
}

.action-panel button:disabled:hover {
  border-color: rgba(174, 184, 189, 0.22);
  background: rgba(9, 13, 17, 0.62);
}

.action-panel button:hover {
  border-color: rgba(255, 221, 126, 0.86);
  background: rgba(38, 32, 20, 0.92);
}

#battleHomeButton {
  grid-column: 1 / -1;
}

.phase-display {
  grid-column: 1 / -1;
  grid-row: 1;
  text-align: center;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.2rem;
}

.phase-display span {
  display: block;
  color: #9ab6c3;
  font-size: clamp(0.7rem, 0.95vw, 0.95rem);
}

.phase-display strong {
  display: block;
  color: var(--text);
  font-size: clamp(0.95rem, 1.35vw, 1.28rem);
  white-space: nowrap;
}

.phase-action,
.icon-button {
  width: 100%;
  border: 1px solid rgba(239, 208, 130, 0.46);
  border-radius: 0.65vh;
  color: var(--text);
  background: rgba(16, 20, 25, 0.8);
  cursor: pointer;
  font-size: clamp(0.68rem, 0.9vw, 0.9rem);
  line-height: 1;
}

.phase-action {
  grid-column: 1;
  grid-row: 2;
}

.icon-button {
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: clamp(1rem, 1.6vw, 1.55rem);
}

.phase-action {
  min-height: 2.55rem;
  padding: 0 0.4vw;
}

.phase-action:hover,
.icon-button:hover {
  border-color: rgba(255, 221, 126, 0.86);
  background: rgba(38, 32, 20, 0.9);
}

.selection-panel {
  position: absolute;
  right: 2.2%;
  bottom: 4.2%;
  width: 18%;
  min-height: 12%;
  border: 1px solid rgba(114, 199, 255, 0.38);
  border-radius: 1.1vh;
  background: rgba(3, 7, 11, 0.78);
  padding: 1vh 0.8vw;
  backdrop-filter: blur(6px);
}

.tutorial-panel {
  position: absolute;
  left: calc(100% + 1.2vw);
  top: calc(20% + 18.9rem);
  width: clamp(190px, 18vw, 270px);
  min-height: 17%;
  border: 1px solid rgba(242, 198, 101, 0.46);
  border-radius: 1.1vh;
  background: rgba(3, 7, 11, 0.84);
  padding: 0.9rem 0.8rem;
  backdrop-filter: blur(8px);
  z-index: 8;
}

.table.is-tutorial .selection-panel {
  display: none;
}

.tutorial-panel strong {
  display: block;
  margin-top: 0.35vh;
  color: #fff5d8;
  font-size: clamp(0.86rem, 1.18vw, 1.12rem);
}

.tutorial-panel p {
  margin: 0.65vh 0 0;
  color: #d8e2e5;
  font-size: clamp(0.66rem, 0.9vw, 0.9rem);
  line-height: 1.55;
}

.card-preview {
  position: fixed;
  left: clamp(14px, 1.6vw, 28px);
  top: 50%;
  width: clamp(240px, 21vw, 340px);
  transform: translateY(-50%);
  z-index: 9;
  pointer-events: none;
}

.preview-frame {
  aspect-ratio: 0.68;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(6.8rem, auto);
  overflow: hidden;
  border: 2px solid rgba(250, 231, 176, 0.82);
  border-radius: 1.2vh;
  background:
    linear-gradient(180deg, rgba(255, 230, 155, 0.18), rgba(0, 0, 0, 0) 34%),
    #14171c;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.52),
    0 0 32px color-mix(in srgb, var(--card-glow, #5c6b75) 44%, transparent);
}

.preview-header {
  min-height: 3.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
  background: rgba(4, 5, 7, 0.72);
}

.preview-header strong {
  min-width: 0;
  color: #fff2c8;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  line-height: 1.15;
}

.preview-art {
  display: grid;
  place-items: center;
  margin: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--card-glow, #5c6b75) 76%, white 12%), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 35%),
    var(--card-glow, #2a3137);
}

.preview-art span {
  padding: 0.32rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 248, 222, 0.86);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
}

.preview-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  color: #dce5e8;
  background: rgba(0, 0, 0, 0.42);
  font-size: 0.86rem;
}

.preview-text {
  margin: 0;
  padding: 0.75rem 0.85rem 0.9rem;
  color: #f0efe3;
  background: rgba(231, 225, 201, 0.08);
  font-size: clamp(0.86rem, 1vw, 1rem);
  line-height: 1.55;
}

.table[data-tutorial-step="reachDevelop"] #nextPhase,
.table[data-tutorial-step="producePeople"] #nextPhase,
.table[data-tutorial-step="reachCombat"] #nextPhase,
.table[data-tutorial-step="developPeople"] #developButton,
.table[data-tutorial-step="reachMain"] #playButton,
.table[data-tutorial-step="playArmy"] #playButton,
.table[data-tutorial-step="attack"] #attackButton {
  border-color: rgba(255, 224, 128, 0.95);
  background: rgba(93, 65, 22, 0.96);
  box-shadow:
    0 0 0 2px rgba(255, 224, 128, 0.22),
    0 0 20px rgba(255, 196, 58, 0.26);
}

.table[data-tutorial-step="developPeople"] .hand,
.table[data-tutorial-step="reachMain"] .hand,
.table[data-tutorial-step="playArmy"] .hand,
.table[data-tutorial-step="reachCombat"] .player-rear,
.table[data-tutorial-step="reachCombat"] .opponent-rear,
.table[data-tutorial-step="attack"] .opponent-rear,
.table[data-tutorial-step="attack"] .player-rear {
  border-color: rgba(255, 224, 128, 0.66);
  box-shadow:
    inset 0 0 26px rgba(255, 196, 58, 0.12),
    0 0 22px rgba(255, 196, 58, 0.18);
}

.log-panel {
  position: absolute;
  left: 21.5%;
  bottom: 4.2%;
  width: 16%;
  min-height: 12%;
  max-height: 18%;
  overflow: hidden;
  border: 1px solid rgba(114, 199, 255, 0.28);
  border-radius: 1.1vh;
  background: rgba(3, 7, 11, 0.62);
  padding: 0.75vh 0.8vw;
  backdrop-filter: blur(6px);
}

.log-panel p {
  margin: 0 0 0.45vh;
  color: #c8d5d9;
  font-size: clamp(0.58rem, 0.78vw, 0.78rem);
  line-height: 1.35;
}

.log-panel .warning {
  color: #ffd27b;
}

.eyebrow {
  display: block;
  color: #70c8ff;
  font-size: clamp(0.55rem, 0.72vw, 0.7rem);
  letter-spacing: 0;
}

.selection-panel strong {
  display: block;
  margin-top: 0.35vh;
  color: #fff5d8;
  font-size: clamp(0.78rem, 1.1vw, 1.05rem);
}

.selection-panel p {
  margin: 0.55vh 0 0;
  color: #c5d2d8;
  font-size: clamp(0.62rem, 0.82vw, 0.82rem);
  line-height: 1.45;
}

.hand,
.opponent-hand {
  position: absolute;
  left: 14%;
  width: 72%;
  height: 17%;
  display: flex;
  justify-content: center;
  gap: 0.55vw;
  padding: 0.5vh 0.8vw;
  border-radius: 1.4vh;
  background: linear-gradient(180deg, rgba(9, 14, 20, 0.96), rgba(4, 7, 11, 0.98));
  border: 1px solid rgba(114, 199, 255, 0.34);
  z-index: 3;
}

.hand {
  bottom: -18.5%;
  align-items: flex-end;
}

.opponent-hand {
  top: -18.5%;
  align-items: flex-start;
  border-color: rgba(230, 190, 108, 0.28);
  background: linear-gradient(180deg, rgba(4, 7, 11, 0.98), rgba(9, 14, 20, 0.94));
}

.card-back {
  width: clamp(54px, 4.4vw, 78px);
  min-height: clamp(72px, 5.8vw, 104px);
  display: grid;
  place-items: center;
  border-radius: 0.75vh;
  border: 1px solid rgba(239, 208, 130, 0.52);
  color: rgba(255, 237, 190, 0.88);
  font-size: clamp(0.62rem, 0.85vw, 0.9rem);
  font-weight: 800;
  background:
    radial-gradient(circle at 50% 28%, rgba(112, 199, 255, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(72, 41, 22, 0.92), rgba(10, 16, 26, 0.98) 54%, rgba(50, 21, 18, 0.94));
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.34);
}

.card {
  width: clamp(86px, 7.6vw, 132px);
  min-height: clamp(76px, 6.5vw, 108px);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 0.75vh;
  border: 1px solid rgba(250, 231, 176, 0.62);
  background:
    linear-gradient(180deg, rgba(248, 217, 132, 0.16), transparent 28%),
    #17191d;
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.34);
  cursor: grab;
  overflow: hidden;
  user-select: none;
}

.zone .card {
  width: clamp(78px, 6.2vw, 112px);
  min-height: clamp(66px, 5.2vw, 92px);
}

.card:active {
  cursor: grabbing;
}

.card.is-selected {
  border-color: #83d4ff;
  box-shadow:
    0 0 0 2px rgba(131, 212, 255, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.42);
}

.card-header {
  min-height: 2.35em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.22vw;
  padding: 0.45vh 0.35vw;
  background: rgba(4, 5, 7, 0.58);
}

.card-name {
  color: #fff2c8;
  font-size: clamp(0.54rem, 0.75vw, 0.76rem);
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58%;
}

.cost {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1px;
  flex: 0 0 auto;
  max-width: 44%;
}

.cost img {
  width: clamp(12px, 0.95vw, 18px);
  height: clamp(12px, 0.95vw, 18px);
  border-radius: 50%;
}

.generic-cost {
  display: grid;
  place-items: center;
  min-width: clamp(13px, 1.05vw, 19px);
  height: clamp(13px, 1.05vw, 19px);
  border-radius: 50%;
  border: 1px solid rgba(245, 232, 190, 0.8);
  color: #fff5d8;
  background: rgba(15, 18, 21, 0.9);
  font-size: clamp(0.5rem, 0.65vw, 0.68rem);
  line-height: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.35vh 0.38vw;
  color: #dce5e8;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--card-glow, #2a3137) 48%, transparent), transparent),
    rgba(255, 255, 255, 0.04);
  font-size: clamp(0.5rem, 0.68vw, 0.7rem);
}

.card-footer {
  min-height: 1.9em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35vh 0.38vw;
  background: rgba(0, 0, 0, 0.36);
  color: #dce5e8;
  font-size: clamp(0.5rem, 0.7vw, 0.7rem);
}

.stats {
  display: grid;
  place-items: center;
  min-width: 2.05em;
  min-height: 1.5em;
  border-radius: 0.45vh;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .home-screen,
  .meta-panel {
    width: 100vw;
    height: auto;
    min-height: 100vh;
  }

  .home-screen {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .profile-strip {
    position: static;
    grid-row: 2;
    flex-wrap: wrap;
  }

  .home-actions {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .meta-content,
  .collection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px), (max-height: 620px) {
  .selection-panel {
    display: none;
  }

  .log-panel {
    display: none;
  }

  .resource-panel {
    left: 2%;
    width: 11%;
  }

  .phase-bar {
    left: calc(100% + 10px);
    width: 190px;
    grid-template-columns: 1fr;
  }

  .action-panel {
    left: calc(100% + 10px);
    width: 180px;
  }

  .tutorial-panel {
    left: calc(100% + 10px);
    width: 180px;
  }

  .card-preview {
    left: 10px;
    width: 220px;
  }
}
