:root {
  --game-bg: #080a10;
  --game-panel: rgba(19, 22, 34, 0.94);
  --game-panel-2: rgba(28, 31, 47, 0.92);
  --game-line: rgba(216, 180, 92, 0.22);
  --game-line-strong: rgba(216, 180, 92, 0.58);
  --game-gold: #d8b45c;
  --game-gold-soft: rgba(216, 180, 92, 0.14);
  --game-red: #b94b38;
  --game-blue: #4fb7b2;
  --game-purple: #8e6bd8;
  --app-tabbar-height: 76px;
}

* {
  scrollbar-color: rgba(216, 180, 92, .42) rgba(9, 11, 18, .72);
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--game-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.game-shell {
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    linear-gradient(135deg, rgba(216, 180, 92, .08), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(79, 183, 178, .13), transparent 28rem),
    radial-gradient(circle at 12% 15%, rgba(185, 75, 56, .14), transparent 30rem),
    radial-gradient(circle at 50% 110%, rgba(142, 107, 216, .12), transparent 36rem),
    var(--game-bg);
}

.app-main {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-touch-callout: none;
}

.game-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 78%);
  z-index: -1;
}

.game-shell .arena-frame {
  position: relative;
}

.game-shell .arena-frame::before,
.game-shell .arena-frame::after {
  content: "";
  position: fixed;
  top: 92px;
  bottom: 92px;
  width: 1px;
  background: linear-gradient(transparent, rgba(216,180,92,.38), transparent);
  pointer-events: none;
}

.game-shell .arena-frame::before {
  left: max(14px, calc((100vw - 1280px) / 2));
}

.game-shell .arena-frame::after {
  right: max(14px, calc((100vw - 1280px) / 2));
}

.arena-topbar {
  background: linear-gradient(180deg, rgba(0,0,0,.86), rgba(11,13,20,.78));
  box-shadow: 0 16px 40px rgba(0,0,0,.36);
}

.app-topbar {
  padding-top: env(safe-area-inset-top);
}

.arena-logo-mark {
  background:
    linear-gradient(135deg, rgba(216,180,92,.30), rgba(216,180,92,.08)),
    radial-gradient(circle, rgba(255,255,255,.16), transparent 58%);
}

.arena-main {
  animation: arenaFadeIn .28s ease-out;
}

@keyframes arenaFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-shell section,
.game-shell aside,
.game-shell .arena-card,
.game-shell .bg-arena-panel {
  border-color: var(--game-line) !important;
}

.game-shell .bg-arena-panel,
.game-shell .arena-card {
  background:
    linear-gradient(180deg, rgba(35, 38, 57, .94), rgba(15, 17, 27, .96)) !important;
  box-shadow:
    0 18px 48px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.045);
}

.game-shell .rounded {
  border-radius: 8px;
}

.game-shell table {
  border-collapse: separate;
  border-spacing: 0;
}

.game-shell th {
  color: #efd892;
  font-weight: 800;
}

.game-shell td,
.game-shell th {
  border-color: rgba(216, 180, 92, .12) !important;
}

.game-shell input,
.game-shell select,
.game-shell textarea {
  background: rgba(6, 8, 14, .72) !important;
  border-color: rgba(216, 180, 92, .22) !important;
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.game-shell input:focus,
.game-shell select:focus,
.game-shell textarea:focus {
  border-color: var(--game-gold) !important;
  box-shadow: 0 0 0 3px rgba(216, 180, 92, .14);
}

.game-shell button,
.game-shell a.rounded {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}

.game-shell button:hover,
.game-shell a.rounded:hover {
  transform: translateY(-1px);
}

.game-shell button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.arena-nav-link {
  border: 1px solid rgba(216, 180, 92, .16);
  background:
    linear-gradient(180deg, rgba(30,33,48,.78), rgba(8,10,17,.78));
  color: rgb(226 232 240);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.arena-nav-link:hover {
  border-color: rgba(216, 180, 92, .68);
  color: #f6d98b;
  box-shadow: 0 0 18px rgba(216, 180, 92, .12), inset 0 1px 0 rgba(255,255,255,.05);
}

.arena-nav-link.is-active {
  border-color: rgba(216, 180, 92, .72);
  color: #080a10;
  background: linear-gradient(180deg, #ffe08b, #c5902f);
}

.mobile-profile-pill,
.mobile-login-pill {
  display: inline-grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(216,180,92,.42);
  border-radius: 999px;
  color: var(--game-gold);
  background: rgba(0,0,0,.28);
  font-weight: 900;
  white-space: nowrap;
}

.mobile-hud {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-gold-pill {
  display: inline-flex;
  min-height: 36px;
  max-width: 112px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216,180,92,.38);
  border-radius: 999px;
  padding: 0 10px;
  color: #f8e6ad;
  background: linear-gradient(180deg, rgba(216,180,92,.16), rgba(0,0,0,.28));
  font-size: .76rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.mobile-login-pill {
  min-width: 72px;
  padding: 0 12px;
}

.is-pressing {
  transform: translateY(1px) scale(.985) !important;
  filter: brightness(1.08);
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  background: rgba(3, 5, 10, .62);
  backdrop-filter: blur(8px);
}

.app-loading.is-visible {
  display: grid;
}

.app-loading div {
  display: grid;
  place-items: center;
  gap: 12px;
  border: 1px solid rgba(216,180,92,.36);
  border-radius: 18px;
  padding: 22px 26px;
  background: rgba(10,12,20,.94);
  box-shadow: 0 24px 70px rgba(0,0,0,.52);
}

.app-loading span {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(216,180,92,.18);
  border-top-color: var(--game-gold);
  border-radius: 999px;
  animation: appSpin .8s linear infinite;
}

.app-loading strong {
  color: rgb(203 213 225);
  font-size: .78rem;
  font-weight: 1000;
  letter-spacing: .16em;
  text-transform: uppercase;
}

@keyframes appSpin {
  to { transform: rotate(360deg); }
}

.rarity-normal { border-color: #94a3b8 !important; }
.rarity-common { border-color: #34d399 !important; }
.rarity-rare { border-color: #38bdf8 !important; }
.rarity-epic { border-color: #e879f9 !important; }
.rarity-legendary { border-color: #facc15 !important; box-shadow: 0 0 24px rgba(250,204,21,.14); }
.rarity-mythic { border-color: #f87171 !important; box-shadow: 0 0 30px rgba(248,113,113,.18); }

.arena-footer {
  background: linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,.92));
  box-shadow: 0 -12px 38px rgba(0,0,0,.34);
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  min-height: calc(var(--app-tabbar-height) + env(safe-area-inset-bottom));
  padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  border-top: 1px solid rgba(216,180,92,.28);
  background: rgba(6, 8, 14, .94);
  box-shadow: 0 -18px 44px rgba(0,0,0,.48);
  backdrop-filter: blur(18px);
}

.mobile-tabbar a {
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgb(148 163 184);
  text-decoration: none;
}

.mobile-tabbar a span {
  display: block;
}

.tab-icon {
  position: relative;
  width: 24px;
  height: 24px;
}

.tab-icon::before,
.tab-icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.tab-home::before {
  inset: 8px 5px 4px;
}

.tab-home::after {
  inset: 4px 7px 10px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 2px;
  transform: rotate(45deg);
}

.tab-deck::before {
  inset: 4px 7px;
  transform: rotate(-6deg);
}

.tab-deck::after {
  inset: 6px 5px;
  transform: rotate(7deg);
}

.tab-gacha::before {
  inset: 4px;
  border-radius: 999px;
}

.tab-gacha::after {
  inset: 9px;
  border-width: 3px;
  transform: rotate(45deg);
}

.tab-battle::before {
  inset: 3px 10px;
  border-radius: 999px;
  transform: rotate(45deg);
}

.tab-battle::after {
  inset: 3px 10px;
  border-radius: 999px;
  transform: rotate(-45deg);
}

.tab-user::before {
  inset: 3px 8px 11px;
  border-radius: 999px;
}

.tab-user::after {
  inset: 12px 5px 3px;
  border-radius: 999px 999px 6px 6px;
}

.tab-login::before {
  inset: 5px 4px;
  border-left-color: transparent;
}

.tab-login::after {
  inset: 8px 7px 8px 3px;
  border-top: 0;
  border-left: 0;
  transform: rotate(-45deg);
}

.tab-join::before {
  inset: 10px 4px;
  border-left: 0;
  border-right: 0;
}

.tab-join::after {
  inset: 4px 10px;
  border-top: 0;
  border-bottom: 0;
}

.mobile-tabbar a strong {
  display: block;
  max-width: 100%;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-tabbar a.is-active {
  border-color: rgba(216,180,92,.48);
  color: var(--game-gold);
  background: rgba(216,180,92,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.mobile-tabbar--guest {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.main-hero {
  position: relative;
  min-height: clamp(520px, 68vh, 720px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  gap: 28px;
  overflow: hidden;
  border: 1px solid rgba(216, 180, 92, .32);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 62px);
  background-image:
    linear-gradient(90deg, rgba(5, 7, 12, .95) 0%, rgba(5, 7, 12, .70) 42%, rgba(5, 7, 12, .28) 100%),
    linear-gradient(180deg, transparent 0%, rgba(5, 7, 12, .88) 100%),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  box-shadow:
    0 30px 90px rgba(0,0,0,.52),
    inset 0 1px 0 rgba(255,255,255,.08);
}

.main-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(216,180,92,.16) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(216,180,92,.10) 0 1px, transparent 1px 100%);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.65), transparent 78%);
}

.main-hero__content,
.main-hero__panel {
  position: relative;
  z-index: 1;
}

.main-hero__eyebrow,
.mode-tile__kicker,
.section-heading span {
  color: var(--game-gold);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.main-hero h1 {
  margin-top: 14px;
  color: #fff8dc;
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 1000;
  line-height: .9;
  text-shadow: 0 0 34px rgba(216,180,92,.28), 0 6px 28px rgba(0,0,0,.72);
}

.main-hero__copy {
  max-width: 680px;
  margin-top: 24px;
  color: rgb(226 232 240);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.75;
}

.main-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.game-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216,180,92,.34);
  border-radius: 8px;
  padding: 0 20px;
  color: #f8fafc;
  font-weight: 900;
  background: linear-gradient(180deg, rgba(28,31,47,.88), rgba(9,11,18,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.game-button--primary {
  color: #120f08;
  border-color: rgba(255,230,148,.88);
  background: linear-gradient(180deg, #ffe08b, #c5902f);
  box-shadow: 0 12px 34px rgba(216,180,92,.22), inset 0 1px 0 rgba(255,255,255,.38);
}

.main-hero__panel {
  display: grid;
  gap: 12px;
  align-self: stretch;
  align-content: end;
}

.hero-stat,
.hero-deck-state {
  border: 1px solid rgba(216,180,92,.26);
  border-radius: 10px;
  padding: 16px;
  background: rgba(7, 9, 15, .70);
  backdrop-filter: blur(10px);
}

.hero-stat span,
.hero-deck-state span,
.hero-deck-state small {
  display: block;
  color: rgb(148 163 184);
  font-size: .78rem;
}

.hero-stat strong,
.hero-deck-state strong {
  display: block;
  margin-top: 6px;
  color: white;
  font-size: 1.35rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.mode-tile,
.notice-board,
.rarity-board {
  border: 1px solid rgba(216,180,92,.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28,31,47,.92), rgba(12,14,22,.96));
  box-shadow: 0 18px 48px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.045);
}

.mode-tile {
  min-height: 170px;
  padding: 22px;
  color: inherit;
  overflow: hidden;
}

.mode-tile strong {
  display: block;
  margin-top: 18px;
  color: #fff;
  font-size: 1.45rem;
}

.mode-tile p,
.notice-item p,
.empty-state {
  margin-top: 10px;
  color: rgb(203 213 225);
  line-height: 1.65;
}

.mode-tile--battle { border-color: rgba(248,113,113,.36); }
.mode-tile--deck { border-color: rgba(79,183,178,.34); }
.mode-tile--gacha { border-color: rgba(216,180,92,.42); }

.home-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-top: 16px;
}

.notice-board,
.rarity-board {
  padding: 22px;
}

.section-heading h2 {
  margin-top: 4px;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
}

.notice-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.notice-item {
  border: 1px solid rgba(216,180,92,.16);
  border-radius: 10px;
  padding: 16px;
  background: rgba(0,0,0,.20);
}

.notice-item h3 {
  color: #fff;
  font-weight: 900;
}

.notice-item time {
  display: block;
  margin-top: 12px;
  color: rgb(100 116 139);
  font-size: .75rem;
}

.rarity-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.rarity-pill,
.admin-rarity-badge,
.admin-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.rarity-pill {
  min-height: 38px;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 900;
  background: rgba(0,0,0,.22);
}

.admin-rarity-badge {
  min-width: 56px;
}

.admin-type-badge {
  min-width: 54px;
  border: 1px solid rgba(216,180,92,.22);
  border-radius: 8px;
  padding: 5px 8px;
  color: #f8fafc;
  background: rgba(0,0,0,.24);
  font-size: .78rem;
  font-weight: 800;
}

.admin-card-table th,
.admin-card-table td {
  vertical-align: middle;
}

.deck-builder-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.deck-builder-head h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 1000;
  line-height: 1;
}

.deck-builder-head p {
  max-width: 760px;
  margin-top: 10px;
  color: rgb(148 163 184);
  line-height: 1.65;
}

.deck-counter {
  flex: 0 0 auto;
  min-width: 150px;
  border: 1px solid rgba(216,180,92,.32);
  border-radius: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(28,31,47,.92), rgba(8,10,17,.92));
  text-align: right;
}

.deck-counter span {
  display: block;
  color: rgb(148 163 184);
  font-size: .78rem;
}

.deck-counter strong {
  display: block;
  color: var(--game-gold);
  font-size: 1.6rem;
  font-weight: 1000;
  white-space: nowrap;
}

.deck-counter.is-full {
  border-color: rgba(52,211,153,.62);
  box-shadow: 0 0 26px rgba(52,211,153,.10);
}

.deck-message {
  margin-bottom: 16px;
  border: 1px solid rgba(216,180,92,.24);
  border-radius: 10px;
  padding: 12px 14px;
}

.deck-message.is-success {
  border-color: rgba(52,211,153,.62);
  background: rgba(6,78,59,.58);
  color: rgb(209 250 229);
}

.deck-message.is-error {
  border-color: rgba(248,113,113,.62);
  background: rgba(127,29,29,.58);
  color: rgb(254 226 226);
}

.deck-builder,
.gacha-stage {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.deck-panel,
.collection-panel,
.summon-panel,
.result-panel,
.recent-card-section {
  min-width: 0;
  border: 1px solid rgba(216,180,92,.24);
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(28,31,47,.92), rgba(12,14,22,.96));
  box-shadow: 0 18px 48px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.045);
}

.deck-panel {
  position: sticky;
  top: 112px;
}

.deck-panel__title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.deck-panel__title strong {
  min-width: 0;
  color: #fff;
  font-size: 1.28rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-deck-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 3px;
}

.selected-card-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid currentColor;
  border-radius: 10px;
  padding: 8px;
  background: rgba(0,0,0,.24);
}

.selected-card-row img {
  width: 56px;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  object-fit: cover;
  background: #050711;
}

.selected-card-row div {
  min-width: 0;
}

.selected-card-row span,
.selected-card-row small {
  display: block;
  color: rgb(148 163 184);
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-card-row strong {
  display: block;
  color: #fff;
  font-size: .88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-action {
  min-width: 48px;
  border: 1px solid rgba(216,180,92,.28);
  border-radius: 8px;
  padding: 7px 9px;
  color: #f8fafc;
  background: rgba(0,0,0,.24);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.card-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  min-width: 0;
}

.card-gallery--results,
.card-gallery--recent {
  margin-top: 16px;
}

.battle-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18,20,31,.98), rgba(6,8,14,.98));
  box-shadow: 0 16px 44px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.06);
}

.battle-card__art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 7;
  background: #050711;
}

.battle-card__art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.battle-card__art span {
  position: absolute;
  left: 10px;
  top: 10px;
  max-width: calc(100% - 20px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(0,0,0,.52);
  font-size: .72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.battle-card__body {
  min-width: 0;
  padding: 12px;
}

.battle-card__meta {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.battle-card__meta span {
  min-width: 0;
  max-width: 50%;
  border: 1px solid rgba(216,180,92,.18);
  border-radius: 999px;
  padding: 3px 7px;
  color: rgb(203 213 225);
  background: rgba(0,0,0,.22);
  font-size: .68rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-card h3 {
  display: -webkit-box;
  min-height: 2.55em;
  margin-top: 9px;
  color: #fff;
  font-size: .95rem;
  font-weight: 1000;
  line-height: 1.28;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.battle-card p {
  display: -webkit-box;
  min-height: 3.6em;
  margin-top: 8px;
  color: rgb(203 213 225);
  font-size: .78rem;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.battle-card small {
  display: block;
  min-height: 1.3em;
  margin-top: 9px;
  color: rgb(148 163 184);
  font-size: .7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-card__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(216,180,92,.13);
  padding: 10px 12px 12px;
}

.battle-card__footer span {
  min-width: 0;
  color: rgb(148 163 184);
  font-size: .74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-card__footer button,
.deck-action {
  border: 1px solid rgba(216,180,92,.38);
  border-radius: 8px;
  padding: 8px 10px;
  color: #100d07;
  background: linear-gradient(180deg, #ffe08b, #c5902f);
  font-size: .78rem;
  font-weight: 1000;
  white-space: nowrap;
}

.battle-card__footer button:disabled,
.deck-action:disabled {
  color: rgb(148 163 184);
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.20);
}

.battle-card__game-actions {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(216,180,92,.13);
  padding: 10px 12px 12px;
}

.battle-card__game-actions:empty {
  display: none;
}

.battle-card__game-actions button {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(216,180,92,.32);
  border-radius: 8px;
  padding: 8px 10px;
  color: #f8fafc;
  background: rgba(0,0,0,.24);
  font-size: .72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-summary {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-card-summary img {
  width: 52px;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  object-fit: cover;
  background: #050711;
}

.admin-card-summary div {
  min-width: 0;
}

.summon-panel p,
.result-message {
  color: rgb(203 213 225);
  line-height: 1.65;
}

.summon-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.summon-actions .game-button {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
}

.summon-actions span {
  font-size: .78rem;
  opacity: .82;
}

.rate-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.rate-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(216,180,92,.12);
  padding: 8px 0;
  color: rgb(203 213 225);
}

.rate-list strong {
  color: var(--game-gold);
  white-space: nowrap;
}

.recent-card-section {
  margin-top: 18px;
}

.reveal-lock {
  overflow: hidden;
}

.reveal-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.reveal-modal.is-open {
  display: flex;
}

.reveal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(216,180,92,.24), transparent 24rem),
    rgba(0,0,0,.78);
  backdrop-filter: blur(14px);
}

.reveal-stage {
  position: relative;
  width: min(100%, 460px);
  max-height: min(92dvh, 760px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(216,180,92,.36);
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(28,31,47,.96), rgba(5,7,12,.98));
  box-shadow: 0 30px 90px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07);
  animation: revealStageIn .22s ease-out;
}

.reveal-stage::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(216,180,92,.14), transparent, rgba(79,183,178,.12), transparent);
  animation: revealAura 4s linear infinite;
  pointer-events: none;
}

.reveal-stage > * {
  position: relative;
  z-index: 1;
}

.reveal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reveal-header span {
  color: var(--game-gold);
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.reveal-header h2 {
  margin-top: 4px;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 1000;
}

.reveal-header button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(216,180,92,.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.24);
  font-size: 1.5rem;
  line-height: 1;
}

.reveal-progress {
  display: grid;
  gap: 8px;
}

.reveal-progress strong {
  color: rgb(203 213 225);
  font-size: .84rem;
}

.reveal-progress i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0,0,0,.34);
}

.reveal-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8b45c, #4fb7b2);
  transition: width .3s ease;
}

.reveal-card-shell {
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  perspective: 1300px;
}

.reveal-card {
  position: relative;
  width: min(78vw, 300px);
  aspect-ratio: 5 / 7;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.2,.8,.2,1), filter .3s ease;
}

.reveal-card.is-front {
  transform: rotateY(180deg) scale(1.02);
  filter: drop-shadow(0 0 28px rgba(216,180,92,.24));
}

.reveal-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  backface-visibility: hidden;
}

.reveal-card__back {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 2px solid rgba(216,180,92,.64);
  background:
    radial-gradient(circle at 50% 38%, rgba(216,180,92,.22), transparent 42%),
    linear-gradient(135deg, #101420, #050711 62%, #2a1f10);
}

.reveal-card__back::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(216,180,92,.34);
  border-radius: 14px;
}

.reveal-card__back span {
  color: #f8e6ad;
  font-size: 4rem;
  font-weight: 1000;
  text-shadow: 0 0 24px rgba(216,180,92,.38);
}

.reveal-card__back strong {
  color: rgb(203 213 225);
  font-size: .78rem;
  font-weight: 1000;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.reveal-card__front {
  transform: rotateY(180deg);
}

.reveal-card__front .battle-card {
  height: 100%;
  border-radius: 18px;
}

.reveal-card__front .battle-card__body {
  padding: 10px;
}

.reveal-card__front .battle-card h3 {
  font-size: .86rem;
}

.reveal-card__front .battle-card p {
  font-size: .7rem;
}

.reveal-hint {
  min-height: 1.5em;
  color: rgb(203 213 225);
  text-align: center;
  font-weight: 900;
}

.reveal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@keyframes revealStageIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes revealAura {
  to { transform: rotate(360deg); }
}

.auth-screen {
  min-height: calc(100dvh - 180px);
  display: grid;
  place-items: center;
}

.auth-card,
.app-panel,
.app-stat-card,
.room-card {
  min-width: 0;
  border: 1px solid rgba(216,180,92,.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(28,31,47,.94), rgba(10,12,20,.98));
  box-shadow: 0 20px 60px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.055);
}

.auth-card {
  width: min(100%, 430px);
  padding: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand .arena-logo-mark {
  width: 54px;
  height: 54px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(216,180,92,.60);
  border-radius: 14px;
  color: var(--game-gold);
  font-size: 1.25rem;
  font-weight: 1000;
}

.auth-brand p,
.app-page-head p,
.app-panel-head span {
  color: var(--game-gold);
  font-size: .74rem;
  font-weight: 1000;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-brand h1,
.app-page-head h1,
.app-panel-head h2 {
  color: #fff;
  font-weight: 1000;
  line-height: 1.05;
}

.auth-brand h1 {
  margin-top: 4px;
  font-size: 1.9rem;
}

.auth-link {
  margin-top: 18px;
  color: rgb(148 163 184);
  text-align: center;
  font-size: .92rem;
}

.auth-link a {
  color: var(--game-gold);
  font-weight: 900;
}

.app-form {
  display: grid;
  gap: 14px;
}

.app-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.app-form label > span {
  color: rgb(203 213 225);
  font-size: .86rem;
  font-weight: 900;
}

.app-form input,
.app-form select,
.room-card__action input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid rgba(216,180,92,.22);
  border-radius: 12px;
  padding: 0 14px;
  color: #f8fafc;
  background: rgba(0,0,0,.26);
  outline: none;
}

.app-form input:focus,
.app-form select:focus,
.room-card__action input:focus {
  border-color: var(--game-gold);
  box-shadow: 0 0 0 3px rgba(216,180,92,.13);
}

.app-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.app-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.app-page-head > div {
  min-width: 0;
}

.app-page-head h1 {
  margin-top: 5px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  overflow-wrap: anywhere;
}

.app-page-head span {
  display: block;
  margin-top: 8px;
  color: rgb(148 163 184);
  line-height: 1.5;
}

.app-page-head > strong,
.status-ready,
.status-warn {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .78rem;
  font-style: normal;
  font-weight: 1000;
  white-space: nowrap;
}

.app-page-head > strong,
.status-ready {
  color: rgb(209 250 229);
  background: rgba(6,95,70,.72);
  border: 1px solid rgba(52,211,153,.32);
}

.status-warn {
  color: rgb(254 226 226);
  background: rgba(127,29,29,.70);
  border: 1px solid rgba(248,113,113,.34);
}

.app-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.app-stat-card {
  padding: 16px;
}

.app-stat-card span {
  display: block;
  color: rgb(148 163 184);
  font-size: .78rem;
}

.app-stat-card strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-panel {
  padding: 18px;
  margin-top: 16px;
}

.app-form-panel {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.app-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.app-panel-head h2 {
  margin-top: 5px;
  font-size: 1.45rem;
}

.app-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0,0,0,.38);
}

.app-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8b45c, #4fb7b2);
}

.app-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.app-primary-action,
.app-secondary-action {
  display: inline-flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 1000;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.app-primary-action {
  border: 1px solid rgba(255,230,148,.86);
  color: #120f08;
  background: linear-gradient(180deg, #ffe08b, #c5902f);
  box-shadow: 0 12px 34px rgba(216,180,92,.18), inset 0 1px 0 rgba(255,255,255,.36);
}

.app-secondary-action {
  border: 1px solid rgba(216,180,92,.26);
  color: #f8fafc;
  background: rgba(0,0,0,.24);
}

.app-step-list {
  display: grid;
  gap: 10px;
}

.app-step-list div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(216,180,92,.14);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0,0,0,.18);
}

.app-step-list b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #120f08;
  background: var(--game-gold);
}

.app-step-list span {
  min-width: 0;
  color: rgb(203 213 225);
  line-height: 1.45;
}

.app-alert {
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 14px;
  line-height: 1.55;
}

.app-alert--error {
  border: 1px solid rgba(248,113,113,.48);
  color: rgb(254 226 226);
  background: rgba(127,29,29,.58);
}

.app-alert a {
  color: #fff;
  font-weight: 1000;
  text-decoration: underline;
}

.app-list {
  display: grid;
  gap: 12px;
}

.app-empty {
  border: 1px dashed rgba(216,180,92,.28);
  border-radius: 18px;
  padding: 32px 18px;
  color: rgb(148 163 184);
  background: rgba(0,0,0,.18);
  text-align: center;
}

.room-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.room-card__body {
  min-width: 0;
}

.room-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-card__title h2 {
  min-width: 0;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card__title span,
.room-card__meta span {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(216,180,92,.16);
  border-radius: 999px;
  padding: 4px 8px;
  color: rgb(203 213 225);
  background: rgba(0,0,0,.20);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

.room-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.room-card__action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-card__action button {
  min-height: 46px;
  border: 1px solid rgba(255,230,148,.78);
  border-radius: 12px;
  padding: 0 16px;
  color: #120f08;
  background: linear-gradient(180deg, #ffe08b, #c5902f);
  font-weight: 1000;
  white-space: nowrap;
}

.room-card__action button:disabled {
  color: rgb(148 163 184);
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.20);
}

.app-danger-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248,113,113,.36);
  border-radius: 12px;
  padding: 0 16px;
  color: rgb(254 226 226);
  background: rgba(127,29,29,.72);
  font-weight: 1000;
  white-space: nowrap;
}

.app-head-form {
  margin: 0;
}

.app-muted-text {
  color: rgb(203 213 225);
  line-height: 1.65;
}

.app-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.app-secondary-action.is-disabled {
  color: rgb(148 163 184);
  background: rgba(15,23,42,.72);
  pointer-events: none;
}

.lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
}

.lobby-player-card {
  min-width: 0;
  border: 1px solid rgba(216,180,92,.18);
  border-radius: 14px;
  padding: 14px;
  background: rgba(0,0,0,.22);
}

.lobby-player-card h3 {
  min-width: 0;
  color: #fff;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-player-card p {
  margin-top: 6px;
  color: rgb(148 163 184);
  font-size: .86rem;
}

.team-picker {
  margin-top: 16px;
  border: 1px solid rgba(216,180,92,.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0,0,0,.20);
}

.team-picker p {
  margin-bottom: 10px;
  color: rgb(203 213 225);
  font-size: .86rem;
  font-weight: 900;
}

.team-picker button {
  flex: 1;
  min-height: 42px;
  border: 1px solid rgba(216,180,92,.24);
  border-radius: 10px;
  color: #f8fafc;
  background: rgba(0,0,0,.20);
  font-weight: 900;
}

.chat-panel {
  margin-top: 16px;
}

.chat-scroll {
  height: min(46dvh, 360px);
  overflow-y: auto;
  border: 1px solid rgba(216,180,92,.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0,0,0,.20);
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.chat-composer input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(216,180,92,.22);
  border-radius: 14px;
  padding: 0 14px;
  color: #f8fafc;
  background: rgba(0,0,0,.28);
  outline: none;
}

.chat-composer button {
  min-height: 48px;
  border: 1px solid rgba(255,230,148,.78);
  border-radius: 14px;
  padding: 0 16px;
  color: #120f08;
  background: linear-gradient(180deg, #ffe08b, #c5902f);
  font-weight: 1000;
  white-space: nowrap;
}

#hand,
#fields,
#players {
  min-width: 0;
}

#game-alert,
#lobby-alert,
#deck-message {
  animation: appToastIn .18s ease-out;
}

@keyframes appToastIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  body.game-shell {
    padding-bottom: calc(var(--app-tabbar-height) + env(safe-area-inset-bottom));
  }

  .app-main {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 12px;
    padding-bottom: calc(var(--app-tabbar-height) + 18px + env(safe-area-inset-bottom));
  }

  .desktop-nav,
  .app-footer {
    display: none !important;
  }

  .mobile-tabbar {
    display: grid;
  }

  .mobile-hud,
  .mobile-login-pill {
    display: flex !important;
  }

  .app-topbar {
    box-shadow: 0 10px 28px rgba(0,0,0,.34);
  }

  .app-topbar > div {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-topbar .arena-logo-mark {
    width: 42px;
    height: 42px;
  }

  .arena-frame::before,
  .arena-frame::after {
    display: none;
  }

  .main-hero,
  .home-board {
    grid-template-columns: 1fr;
  }

  .mode-grid,
  .deck-builder,
  .gacha-stage {
    grid-template-columns: 1fr;
  }

  .main-hero__panel {
    align-self: auto;
  }

  .deck-panel {
    position: static;
  }

  .selected-deck-list {
    max-height: min(24dvh, 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .deck-builder-head {
    display: grid;
    gap: 14px;
  }

  .deck-builder-head > div > p:last-child {
    display: none;
  }

  .deck-builder-head h1 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  .deck-counter {
    width: 100%;
    text-align: left;
  }

  .deck-builder {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .deck-panel,
  .collection-panel {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .selected-deck-list {
    display: grid;
    gap: 10px;
  }

  .collection-panel .card-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }

  .collection-panel .battle-card {
    flex: 0 0 min(58vw, 230px);
    scroll-snap-align: start;
  }

  .reveal-modal {
    align-items: center;
    padding: 10px 10px calc(var(--app-tabbar-height) + 10px + env(safe-area-inset-bottom));
  }

  .reveal-stage {
    width: min(100%, 430px);
    max-height: calc(100dvh - var(--app-tabbar-height) - 26px - env(safe-area-inset-bottom));
    gap: 8px;
    overflow-y: auto;
    border-radius: 18px;
    padding: 12px;
  }

  .reveal-card {
    width: min(58vw, 220px);
  }

  .reveal-card__front .battle-card p {
    min-height: auto;
    -webkit-line-clamp: 2;
  }

  .reveal-card__front .battle-card small {
    display: none;
  }

  .reveal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.game-shell {
    padding-bottom: calc(var(--app-tabbar-height) + env(safe-area-inset-bottom));
  }

  .app-main {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 12px;
    padding-bottom: calc(var(--app-tabbar-height) + 18px + env(safe-area-inset-bottom));
  }

  .app-footer {
    display: none;
  }

  .mobile-tabbar {
    display: grid;
  }

  .app-topbar .arena-logo-mark {
    width: 42px;
    height: 42px;
  }

  .app-topbar {
    box-shadow: 0 10px 28px rgba(0,0,0,.34);
  }

  .app-topbar > div {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-topbar .group span:last-child span:first-child {
    max-width: 132px;
    font-size: 1rem;
  }

  .app-topbar .group span:last-child span:last-child {
    max-width: 132px;
    font-size: .58rem;
    letter-spacing: .16em;
  }

  .arena-frame::before,
  .arena-frame::after {
    display: none;
  }

  .game-shell input,
  .game-shell select,
  .game-shell textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .game-shell button,
  .game-shell a.rounded,
  .game-button {
    min-height: 44px;
  }

  .main-hero {
    min-height: calc(100dvh - 162px);
    border-radius: 20px;
    padding: 20px;
    align-content: end;
    background-position: 58% center;
  }

  .main-hero h1 {
    font-size: clamp(2.8rem, 18vw, 4rem);
  }

  .main-hero__copy {
    font-size: .98rem;
    line-height: 1.6;
  }

  .main-hero__panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-stat,
  .hero-deck-state {
    min-width: 0;
    padding: 10px;
  }

  .hero-stat strong,
  .hero-deck-state strong {
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-button {
    width: 100%;
  }

  .deck-builder-head {
    display: grid;
    gap: 14px;
  }

  .auth-screen {
    min-height: auto;
    place-items: stretch;
  }

  .auth-card {
    width: 100%;
    border-radius: 18px;
    padding: 18px;
  }

  .app-page-head {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }

  .app-page-head .app-primary-action,
  .app-page-head .app-secondary-action {
    width: 100%;
  }

  .app-stat-grid,
  .app-action-grid,
  .app-form-grid {
    grid-template-columns: 1fr;
  }

  .app-panel {
    border-radius: 16px;
    padding: 14px;
  }

  .mode-tile,
  .notice-board,
  .rarity-board,
  .auth-card,
  .app-panel,
  .app-stat-card,
  .room-card,
  .battle-card {
    box-shadow: 0 12px 34px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.05);
  }

  .app-panel-head {
    align-items: flex-start;
  }

  .app-primary-action,
  .app-secondary-action {
    width: 100%;
    min-height: 50px;
  }

  .room-card {
    grid-template-columns: 1fr;
    border-radius: 16px;
    padding: 14px;
  }

  .room-card__title {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-card__title h2 {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .room-card__action {
    display: grid;
    grid-template-columns: 1fr;
  }

  .room-card__action input,
  .room-card__action button {
    width: 100%;
  }

  .lobby-layout {
    grid-template-columns: 1fr;
  }

  .app-head-form,
  .app-danger-action {
    width: 100%;
  }

  .chat-scroll {
    height: 40dvh;
    min-height: 260px;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }

  .chat-composer button {
    width: 100%;
  }

  .reveal-modal {
    align-items: center;
    padding: 10px 10px calc(var(--app-tabbar-height) + 10px + env(safe-area-inset-bottom));
  }

  .reveal-stage {
    width: min(100%, 430px);
    max-height: calc(100dvh - var(--app-tabbar-height) - 26px - env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 18px;
    padding: 12px;
  }

  .reveal-card {
    width: min(58vw, 220px);
  }

  .reveal-actions {
    grid-template-columns: 1fr;
  }

  .deck-counter {
    width: 100%;
    text-align: left;
  }

  .deck-panel,
  .collection-panel,
  .summon-panel,
  .result-panel,
  .recent-card-section {
    padding: 14px;
  }

  .card-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-gallery--results,
  .card-gallery--recent {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
  }

  .card-gallery--results .battle-card,
  .card-gallery--recent .battle-card {
    flex: 0 0 min(58vw, 220px);
    scroll-snap-align: start;
  }

  #hand {
    display: flex !important;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
  }

  #hand .battle-card {
    flex: 0 0 min(62vw, 230px);
    scroll-snap-align: center;
  }

  #fields {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  #fields .battle-card h3,
  #hand .battle-card h3 {
    min-height: 2.4em;
  }

  .battle-card h3 {
    font-size: .82rem;
  }

  .battle-card p {
    font-size: .72rem;
  }

  .battle-card__footer {
    grid-template-columns: 1fr;
  }

  .battle-card__footer button {
    width: 100%;
  }

  .selected-card-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .selected-card-row img {
    width: 48px;
  }
}

@media (max-width: 380px) {
  .mobile-tabbar {
    gap: 2px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .mobile-tabbar a strong {
    font-size: 10px;
  }

  .card-gallery {
    grid-template-columns: 1fr;
  }
}
