:root {
  --bg: #08111b;
  --panel: rgba(17, 26, 39, 0.78);
  --panel-strong: rgba(10, 18, 30, 0.9);
  --ink: #eef4ff;
  --muted: #a6b6cb;
  --line: rgba(157, 213, 255, 0.16);
  --accent: #83ebff;
  --accent-strong: #7fa8ff;
  --violet: #c59cff;
  --crystal-aqua: rgba(111, 235, 255, 0.26);
  --crystal-blue: rgba(126, 168, 255, 0.24);
  --crystal-violet: rgba(197, 156, 255, 0.22);
  --crystal-pink: rgba(255, 174, 228, 0.18);
  --shadow: 0 28px 70px rgba(2, 8, 22, 0.52);
  --card-width-mm: 63mm;
  --card-height-mm: 88mm;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(111, 235, 255, 0.2), transparent 20%),
    radial-gradient(circle at 86% 6%, rgba(197, 156, 255, 0.18), transparent 24%),
    radial-gradient(circle at 50% 18%, rgba(126, 168, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #060b12 0%, #0a1520 38%, #08111b 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(125deg, transparent 0 38%, rgba(255, 255, 255, 0.03) 45%, transparent 52%),
    linear-gradient(215deg, transparent 0 48%, rgba(126, 168, 255, 0.05) 54%, transparent 60%),
    linear-gradient(332deg, transparent 0 58%, rgba(197, 156, 255, 0.04) 64%, transparent 70%);
  opacity: 0.9;
}

body::after {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 16%, rgba(131, 235, 255, 0.12) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 72%, rgba(197, 156, 255, 0.08) 0 1px, transparent 1.5px);
  background-size: 180px 180px, 240px 240px, 280px 280px;
  opacity: 0.35;
}

body[data-page="deck-editor"] {
  background:
    radial-gradient(circle at 14% 8%, rgba(111, 235, 255, 0.14), transparent 20%),
    radial-gradient(circle at 86% 6%, rgba(126, 168, 255, 0.12), transparent 24%),
    radial-gradient(circle at 50% 18%, rgba(85, 145, 225, 0.1), transparent 30%),
    linear-gradient(180deg, #050b13 0%, #09131f 38%, #07111b 100%);
}

body[data-page="deck-editor"]::before {
  background:
    linear-gradient(125deg, transparent 0 38%, rgba(255, 255, 255, 0.03) 45%, transparent 52%),
    linear-gradient(215deg, transparent 0 48%, rgba(126, 168, 255, 0.05) 54%, transparent 60%),
    linear-gradient(332deg, transparent 0 58%, rgba(77, 123, 196, 0.04) 64%, transparent 70%);
}

body[data-page="deck-editor"]::after {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 16%, rgba(131, 235, 255, 0.1) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 72%, rgba(126, 168, 255, 0.08) 0 1px, transparent 1.5px);
}

body[data-page="deck-editor"] .top-nav,
body[data-page="deck-editor"] .panel.top-nav {
  background:
    linear-gradient(180deg, rgba(8, 18, 30, 0.95), rgba(11, 20, 33, 0.84)),
    radial-gradient(circle at left center, rgba(131, 235, 255, 0.08), transparent 30%);
}

body[data-page="deck-editor"] .nav-avatar,
body[data-page="deck-editor"] .nav-bell-badge,
body[data-page="deck-editor"] .add-button,
body[data-page="deck-editor"] .primary-button,
body[data-page="deck-editor"] .view-toggle-button.is-active,
body[data-page="deck-editor"] .curve-bar-fill {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), transparent 34%),
    linear-gradient(135deg, #6ea8ff, #82ecff);
}

body[data-page="deck-editor"] .nav-bell-badge {
  color: #071018;
}

body[data-page="deck-editor"] .nav-link.is-active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 38%),
    linear-gradient(135deg, #7fa8ff, #83ebff);
}

body[data-page="deck-editor"] h1 {
  background: linear-gradient(180deg, #ffffff 0%, #dff2ff 34%, #bcd8ff 62%, #cde8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-page="deck-editor"] h2 {
  background: linear-gradient(180deg, #fdfefe 0%, #d8efff 46%, #b9d7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-page="deck-editor"] .deck-workspace-title,
body[data-page="deck-editor"] .deck-row-name,
body[data-page="deck-editor"] .deck-image-name {
  text-shadow: 0 10px 24px rgba(96, 190, 255, 0.16);
}

body[data-page="deck-editor"] .search-suggestion-item:hover,
body[data-page="deck-editor"] .search-suggestion-item:focus-visible,
body[data-page="deck-editor"] .toggle-history-button.is-active,
body[data-page="deck-editor"] #toggle-history-button.is-active {
  background: rgba(129, 215, 255, 0.1);
}

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

.page-shell {
  width: min(1460px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 40px;
  overflow: visible;
}

.page-stack {
  display: grid;
  gap: 22px;
}

.page-hero,
.welcome-hero {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.builder-hero {
  gap: 10px;
  padding: 18px 22px;
}

.builder-hero h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1;
  max-width: none;
}

.builder-hero .hero-text {
  margin: 0;
  max-width: 70ch;
  font-size: 0.98rem;
}

.builder-entry-panel {
  display: grid;
  gap: 26px;
  min-height: calc(100vh - 190px);
  align-content: center;
  justify-items: center;
  text-align: center;
}

.builder-entry-actions,
.builder-modify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.builder-entry-title {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.92;
  max-width: 10ch;
}

.builder-entry-button {
  min-width: 260px;
  min-height: 66px;
  justify-content: center;
  font-size: 1.05rem;
}

.builder-modify-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.welcome-hero {
  min-height: calc(100vh - 240px);
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding-top: 16px;
}

.welcome-logo {
  width: min(380px, 64vw);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 18px 44px rgba(125, 215, 255, 0.22));
}

.welcome-message {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 26px rgba(131, 235, 255, 0.12);
}

.welcome-beta-badge {
  margin: -2px 0 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(131, 235, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(111, 235, 255, 0.18), rgba(197, 156, 255, 0.18)),
    rgba(255, 255, 255, 0.04);
  color: #e9fbff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(111, 235, 255, 0.12);
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: -4px;
}

.welcome-actions .primary-button,
.welcome-actions .ghost-button {
  min-width: 200px;
}

.hero,
.panel {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.07), transparent 24%),
    linear-gradient(180deg, rgba(15, 24, 37, 0.94), rgba(10, 17, 28, 0.84)),
    radial-gradient(circle at top right, var(--crystal-blue), transparent 42%);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: visible;
}

.hero::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, transparent 0 46%, rgba(255, 255, 255, 0.045) 51%, transparent 56%),
    linear-gradient(210deg, transparent 0 62%, rgba(131, 235, 255, 0.05) 68%, transparent 74%);
  pointer-events: none;
  opacity: 0.85;
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 0.8fr;
  gap: 24px;
  padding: 28px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, var(--crystal-aqua), transparent 22%),
    radial-gradient(circle at 48% 0%, var(--crystal-violet), transparent 28%),
    radial-gradient(circle at 88% 18%, var(--crystal-pink), transparent 24%);
  pointer-events: none;
}

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

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: #d8e9ff;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.73rem;
  font-weight: 700;
  text-shadow: 0 0 16px rgba(131, 235, 255, 0.16);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.03em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  line-height: 0.9;
  max-width: 11ch;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #dff2ff 34%, #bcd8ff 62%, #f0d8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 10px 34px rgba(126, 168, 255, 0.14);
}

h2 {
  font-size: 1.8rem;
  color: transparent;
  background: linear-gradient(180deg, #fdfefe 0%, #d8efff 46%, #cdb6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 8px 24px rgba(131, 235, 255, 0.12);
}

h3 {
  color: #f5fbff;
  text-shadow: 0 6px 18px rgba(126, 168, 255, 0.1);
}

.hero-text,
.print-copy,
.card-rules,
.deck-row-meta,
.profile-handle {
  color: var(--muted);
  line-height: 1.62;
  letter-spacing: 0.01em;
}

.status-success {
  color: #8ff2ae !important;
}

.status-error {
  color: #ffb1b1 !important;
}

.status-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 224, 255, 0.42);
  background: linear-gradient(135deg, rgba(101, 218, 255, 0.2), rgba(177, 144, 255, 0.2));
  color: #f4fbff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(67, 180, 255, 0.16);
}

.status-action-link:hover,
.status-action-link:focus-visible {
  border-color: rgba(149, 237, 255, 0.62);
  background: linear-gradient(135deg, rgba(101, 218, 255, 0.28), rgba(177, 144, 255, 0.28));
  outline: none;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 146px 1fr;
  align-items: center;
  gap: 18px;
}

.brand-mark-shell {
  display: grid;
  place-items: center;
  width: 146px;
  height: 146px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(111, 212, 255, 0.06));
  border: 1px solid rgba(180, 220, 255, 0.12);
}

.brand-logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(125, 215, 255, 0.28));
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px 18px;
  position: relative;
  z-index: 9999;
  overflow: visible;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(12, 21, 32, 0.95), rgba(14, 22, 34, 0.82)),
    radial-gradient(circle at left center, rgba(131, 235, 255, 0.12), transparent 30%);
}

body.app-boot-loading [data-login-nav],
body.app-boot-loading [data-signup-nav],
body.app-boot-loading [data-logout-nav],
body.app-boot-loading [data-auth-logged-in],
body.app-boot-loading [data-auth-logged-out],
body.app-boot-loading .profile-menu,
body.app-boot-loading .notification-menu {
  visibility: hidden;
}

.top-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  width: 100%;
  overflow: visible;
  position: relative;
  z-index: 1100;
}

.nav-discord-link {
  order: 40;
  gap: 8px;
  border-color: rgba(88, 101, 242, 0.36);
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.22), rgba(124, 231, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.top-nav-links [data-route-link="builder"] {
  order: 10;
}

.top-nav-links .nav-explore-dropdown {
  order: 20;
}

.top-nav-links [data-playmode-top-link] {
  order: 30;
}

.top-nav-links [data-login-nav],
.top-nav-links [data-signup-nav],
.top-nav-links .nav-notification-dropdown,
.top-nav-links .nav-avatar-dropdown,
.top-nav-links [data-profile-menu],
.top-nav-links [data-logout-nav] {
  order: 70;
}

.top-nav-links [data-signup-nav] {
  order: 71;
}

.top-nav-links .nav-avatar-dropdown,
.top-nav-links [data-profile-menu] {
  order: 71;
}

.top-nav-links [data-logout-nav] {
  order: 72;
}

.top-nav-links [data-admin-top-link] {
  order: 69;
}

.top-nav-links .nav-auth-start {
  margin-left: auto;
}

.nav-discord-link:hover {
  border-color: rgba(139, 151, 255, 0.74);
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.22);
}

.discord-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5865f2, #7c8cff);
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.28);
}

.discord-icon svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

.menu-logo-link {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(180, 220, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 40%),
    linear-gradient(145deg, rgba(111, 235, 255, 0.11), rgba(126, 168, 255, 0.08));
  padding: 0;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  overflow: hidden;
}

.menu-logo {
  width: 72%;
  height: 72%;
  object-fit: contain;
  object-position: center;
  transform: none;
  display: block;
  padding: 0;
  margin: auto;
}

.menu-logo-full {
  mix-blend-mode: normal;
}

.welcome-logo-full {
  mix-blend-mode: screen;
}

.menu-logo-link:hover {
  transform: translateY(-1px);
  border-color: rgba(180, 220, 255, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(111, 212, 255, 0.08));
}

.nav-link {
  color: #d7e8fa;
  text-decoration: none;
  padding: 13px 18px;
  border-radius: 16px;
  border: 1px solid rgba(180, 220, 255, 0.1);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-shadow: 0 4px 16px rgba(126, 168, 255, 0.1);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: rgba(180, 220, 255, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.05));
}

.nav-link.is-active {
  color: #071018;
  font-weight: 700;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 38%),
    linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.nav-dropdown {
  position: relative;
  z-index: 10010;
  overflow: visible;
}

.nav-dropdown[open] {
  z-index: 10020;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(7, 13, 21, 0.985), rgba(14, 23, 35, 0.985));
  border: 1px solid rgba(126, 177, 255, 0.18);
  box-shadow: 0 22px 48px rgba(3, 7, 18, 0.52);
  z-index: 10030;
  pointer-events: auto;
  overflow: auto;
}

.nav-dropdown:not([open]) .nav-dropdown-menu {
  display: none;
}

.nav-dropdown-link {
  width: 100%;
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(180, 220, 255, 0.08);
}

.nav-dropdown-link:hover {
  background: linear-gradient(135deg, rgba(111, 212, 255, 0.22), rgba(115, 147, 255, 0.18));
}

.explore-dropdown-menu,
.profile-dropdown-menu {
  min-width: 260px;
}

.nav-explore-dropdown > .nav-dropdown-menu,
.nav-avatar-dropdown > .nav-dropdown-menu {
  z-index: 10040;
  visibility: visible;
  opacity: 1;
}

.nav-dropdown-menu.is-floating {
  z-index: 2147483647 !important;
}

.panel.top-nav {
  overflow: visible !important;
}

.page-hero,
.welcome-hero,
.page-stack,
main {
  position: relative;
  z-index: 1;
}

.nav-avatar-dropdown {
  margin-left: auto;
}

.nav-login-link {
  margin-left: auto;
}

.nav-notification-dropdown {
  margin-left: auto;
}

.nav-notification-dropdown + .nav-avatar-dropdown {
  margin-left: 0;
}

.nav-avatar-trigger {
  list-style: none;
}

.nav-avatar-trigger::-webkit-details-marker {
  display: none;
}

.nav-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #081018;
  border: 1px solid rgba(180, 220, 255, 0.14);
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 10px 20px rgba(111, 212, 255, 0.18);
}

.nav-avatar.profile-avatar-image {
  background-size: 235%;
  background-position: center 20%;
  background-repeat: no-repeat;
}

.nav-bell-trigger {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(180, 220, 255, 0.14);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
}

.nav-bell-icon {
  font-size: 1.05rem;
  color: #dff8ff;
  text-shadow: 0 0 18px rgba(127, 237, 255, 0.28);
}

.nav-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #071018;
  background: linear-gradient(135deg, #8ffff5, #7cc8ff);
  box-shadow: 0 8px 18px rgba(89, 219, 255, 0.28);
}

.notification-dropdown-menu {
  min-width: 340px;
}

.notification-menu-header {
  padding: 4px 4px 8px;
  color: #f3fbff;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  display: grid;
  gap: 4px;
  position: relative;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid rgba(171, 226, 255, 0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
}

.notification-item.is-unread {
  border-color: rgba(131, 235, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(131, 235, 255, 0.06);
}

.notification-item.is-unread::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7ef8ff, #c59cff);
  box-shadow: 0 0 18px rgba(131, 235, 255, 0.35);
}

.notification-item strong {
  color: #f4fcff;
  font-size: 0.9rem;
}

.notification-item span,
.notification-item small {
  color: var(--muted);
}

.nav-logout-link {
  margin-left: 0;
}

.nav-link-danger {
  color: #ffd0d0;
  border-color: rgba(255, 129, 129, 0.22);
  background: linear-gradient(180deg, rgba(120, 30, 30, 0.26), rgba(80, 18, 18, 0.18));
}

.nav-link-danger:hover {
  color: #fff1f1;
  border-color: rgba(255, 129, 129, 0.42);
  background: linear-gradient(180deg, rgba(156, 40, 40, 0.36), rgba(102, 20, 20, 0.26));
}

.stat-card,
.summary-card,
.mini-stat {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.stat-card {
  padding: 18px;
}

.stat-card span,
.mini-stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.73rem;
}

.stat-card strong {
  font-size: 2rem;
  color: #f7fbff;
  text-shadow: 0 8px 24px rgba(131, 235, 255, 0.14);
}

.app-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
}

.page-section[hidden] {
  display: none !important;
}

.sidebar-stack,
.content-stack,
.deck-column,
.summary-column {
  display: grid;
  gap: 22px;
}

.panel {
  padding: 22px;
}

.panel-header,
.workspace-top,
.deck-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.profile-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-panel.public-profile-view .profile-card {
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding-bottom: 8px;
}

.profile-panel.public-profile-view .profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 22px;
}

.profile-panel.public-profile-view .profile-metrics,
.profile-panel.public-profile-view [data-auth-logged-in],
.profile-panel.public-profile-view [data-auth-logged-out] {
  display: none !important;
}

.profile-panel.public-profile-view #explore-profile-card {
  display: grid !important;
  gap: 8px;
  margin-top: 4px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #091019;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 10px 20px rgba(111, 212, 255, 0.22);
}

.profile-avatar-image {
  background-size: 235%;
  background-position: center 20%;
  background-repeat: no-repeat;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field select,
input[type="search"] {
  width: 100%;
  border: 1px solid rgba(180, 215, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5.25 7 9l4-3.75' fill='none' stroke='%23dff2ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: 0 0, 0 0, calc(100% - 16px) 50%;
  background-size: auto, auto, 14px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(9, 18, 31, 0.18);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.field select option,
select option {
  color: #061421;
  background: #f4fbff;
}

.field select option:checked,
select option:checked {
  color: #ffffff;
  background: #0f4f7a;
}

.field select:hover,
.field input:hover,
input[type="search"]:hover {
  border-color: rgba(170, 228, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 30px rgba(10, 22, 38, 0.2);
}

.field select:focus,
.field input:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(131, 235, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(131, 235, 255, 0.22),
    0 12px 30px rgba(89, 173, 255, 0.12);
  transform: translateY(-1px);
}

.create-profile-grid,
.profile-metrics,
.auth-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.auth-card {
  padding: 18px;
}

.profile-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stat {
  padding: 14px;
}

.following-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.follow-chip {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  letter-spacing: 0.02em;
}

.profile-decks {
  display: grid;
  gap: 10px;
}

.profile-decks.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.profile-deck-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 34%),
    rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.profile-deck-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--deck-card-cover, none);
  background-size: 168%;
  background-position: center 18%;
  opacity: 0.2;
  pointer-events: none;
}

.profile-deck-card > * {
  position: relative;
  z-index: 1;
}

.profile-deck-card.is-deck-of-day {
  border-color: rgba(255, 222, 118, 0.58);
  box-shadow:
    0 20px 42px rgba(255, 205, 91, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.explore-featured-decks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 6px;
}

.explore-featured-daily {
  display: grid;
}

.explore-featured-daily .profile-deck-card {
  height: 100%;
}

.most-liked-decks-panel {
  border: 1px solid rgba(124, 231, 255, 0.38);
  border-radius: 20px;
  padding: 14px;
  background:
    radial-gradient(circle at 12% 8%, rgba(124, 231, 255, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(5, 23, 39, 0.88), rgba(8, 15, 26, 0.9));
  box-shadow:
    0 22px 44px rgba(0, 12, 26, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.most-liked-decks-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.most-liked-decks-header h3 {
  margin: 0;
  color: #dff8ff;
  font-size: 1.05rem;
}

.most-liked-decks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-deck-card.is-most-liked-deck {
  border-color: rgba(124, 231, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(124, 231, 255, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.most-followed-users-panel {
  grid-column: 1 / -1;
}

.explore-featured-users .most-followed-users-panel {
  grid-column: auto;
}

.most-followed-users-grid {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.profile-deck-card.is-most-followed-user {
  border-color: rgba(124, 231, 255, 0.3);
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 231, 255, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.035);
}

.profile-deck-card.is-most-followed-user .profile-user-avatar {
  box-shadow: 0 0 0 1px rgba(124, 231, 255, 0.24), 0 14px 30px rgba(0, 14, 28, 0.22);
}

.profile-deck-card.is-duelist-of-day {
  border-color: rgba(255, 222, 118, 0.58);
  box-shadow:
    0 20px 42px rgba(255, 205, 91, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.duelist-of-day-badge {
  color: #fff0a8;
}

.explore-sort-field {
  width: min(210px, 100%);
  margin-left: auto;
}

@media (max-width: 920px) {
  .explore-featured-decks {
    grid-template-columns: 1fr;
  }

  .most-liked-decks-grid,
  .most-followed-users-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .most-liked-decks-grid,
  .most-followed-users-grid {
    grid-template-columns: 1fr;
  }

  .most-liked-decks-header {
    display: grid;
  }
}

.deck-of-day-badge {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 222, 118, 0.58);
  border-radius: 999px;
  padding: 6px 10px;
  background:
    linear-gradient(135deg, rgba(255, 222, 118, 0.22), rgba(124, 231, 255, 0.1)),
    rgba(6, 18, 31, 0.74);
  color: #fff0a8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 0 22px rgba(255, 218, 106, 0.16);
}

.profile-deck-cover {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 14px;
  margin-bottom: 6px;
  background-size: 168%;
  background-position: center 18%;
  background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, 0.04);
}

.profile-deck-card span,
.profile-deck-card small {
  color: var(--muted);
  line-height: 1.45;
}

.profile-deck-card .deck-format-pill {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(124, 231, 255, 0.24);
  border-radius: 999px;
  padding: 5px 9px;
  background:
    linear-gradient(135deg, rgba(124, 231, 255, 0.12), rgba(255, 222, 118, 0.08)),
    rgba(7, 23, 39, 0.72);
  color: #dff8ff;
  font-size: 0.72rem;
  font-weight: 800;
}

.profile-deck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.deck-like-meta {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.deck-like-count {
  font-size: 0.8rem;
  color: #c6f5ff;
  letter-spacing: 0.02em;
}

.deck-liked-by {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deck-like-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(135, 222, 255, 0.24);
  background: rgba(113, 204, 255, 0.08);
  color: #e9fbff;
  font-size: 0.74rem;
  line-height: 1;
}

.profile-inline-button {
  flex: 1 1 120px;
  text-align: center;
  min-height: 42px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.compact-grid .profile-deck-card {
  padding: 10px;
  gap: 2px;
  border-radius: 16px;
}

.compact-grid .profile-deck-cover {
  aspect-ratio: 16 / 8;
  border-radius: 12px;
  margin-bottom: 4px;
}

.compact-grid .profile-deck-card strong {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.compact-grid .profile-deck-card span,
.compact-grid .profile-deck-card small {
  font-size: 0.8rem;
}

.compact-grid .deck-like-chip {
  font-size: 0.7rem;
}

.profile-user-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  margin-bottom: 6px;
  background-color: rgba(255, 255, 255, 0.04);
}

.avatar-preset-browser {
  display: grid;
  gap: 18px;
}

.avatar-selection-preview {
  display: flex;
}

.avatar-preview-card {
  width: 120px;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background-size: 170%;
  background-position: center 20%;
  background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, 0.04);
}

.avatar-preset-section {
  display: grid;
  gap: 10px;
}

.avatar-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.avatar-preset-card {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--avatar-accent, rgba(168, 220, 255, 0.72)) 48%, rgba(255,255,255,0.12));
  border-radius: 18px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.04);
  color: var(--ink);
  display: grid;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.avatar-preset-card:hover {
  transform: translateY(-2px);
  border-color: var(--avatar-accent, rgba(132, 228, 255, 0.34));
  box-shadow:
    0 12px 28px rgba(9, 20, 35, 0.24),
    0 0 0 1px color-mix(in srgb, var(--avatar-accent, rgba(132, 228, 255, 0.34)) 55%, transparent);
}

.avatar-preset-card.is-selected {
  border-color: rgba(124, 231, 255, 0.88);
  box-shadow:
    0 0 0 2px rgba(124, 231, 255, 0.36),
    0 18px 34px rgba(91, 205, 255, 0.16);
}

.avatar-preset-card.is-selected .avatar-preset-art {
  border-color: rgba(124, 231, 255, 0.88);
}

.avatar-in-use-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: none;
  border: 1px solid rgba(255, 222, 118, 0.72);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(6, 18, 31, 0.82);
  color: #fff0a8;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(255, 222, 118, 0.22);
}

.avatar-preset-card.is-in-use .avatar-in-use-badge {
  display: inline-flex;
}

.avatar-preset-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background-size: 168%;
  background-position: center 20%;
  background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, 0.04);
  border: 2px solid color-mix(in srgb, var(--avatar-accent, rgba(168, 220, 255, 0.72)) 52%, rgba(255,255,255,0.16));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.avatar-preset-card small {
  color: var(--muted);
  line-height: 1.3;
}

.avatar-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.avatar-picker-save-button {
  background: linear-gradient(180deg, rgba(80, 220, 139, 0.98), rgba(31, 143, 84, 0.98));
  color: #04120a;
  box-shadow:
    0 14px 28px rgba(41, 198, 116, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.avatar-picker-save-button:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(108, 244, 165, 1), rgba(38, 164, 96, 1));
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.68);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  margin: 30px auto;
}

.auth-modal-panel {
  width: min(520px, calc(100vw - 40px));
}

.playmode-construction-panel {
  width: min(760px, calc(100vw - 34px));
  overflow: hidden;
  padding: clamp(28px, 5vw, 46px);
  border-color: rgba(124, 231, 255, 0.28);
  background:
    radial-gradient(circle at 20% 12%, rgba(124, 231, 255, 0.24), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(255, 214, 112, 0.18), transparent 24%),
    linear-gradient(145deg, rgba(4, 22, 39, 0.98), rgba(5, 12, 24, 0.98));
  box-shadow: 0 32px 90px rgba(0, 8, 20, 0.62), inset 0 1px 0 rgba(255,255,255,0.1);
}

.playmode-construction-page {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(30px, 6vw, 60px);
  border-color: rgba(124, 231, 255, 0.28);
  background:
    radial-gradient(circle at 14% 8%, rgba(124, 231, 255, 0.22), transparent 30%),
    radial-gradient(circle at 86% 10%, rgba(255, 214, 112, 0.16), transparent 26%),
    linear-gradient(145deg, rgba(4, 22, 39, 0.96), rgba(5, 12, 24, 0.98));
}

.playmode-construction-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(124, 231, 255, 0.09) 42% 43%, transparent 43% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 58px);
  opacity: 0.78;
}

.playmode-construction-panel > * {
  position: relative;
  z-index: 1;
}

.playmode-construction-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 48%, rgba(124, 231, 255, 0.08) 48% 49%, transparent 49% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 64px);
}

.playmode-construction-page > * {
  position: relative;
  z-index: 1;
}

.playmode-construction-orb {
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 36% 30%, #ffffff 0 10%, #ffe884 11% 32%, rgba(124, 231, 255, 0.92) 33% 54%, rgba(16, 44, 78, 0.95) 55% 100%);
  box-shadow: 0 0 34px rgba(124, 231, 255, 0.48), 0 0 72px rgba(255, 226, 116, 0.22);
}

.playmode-construction-panel h2,
.playmode-construction-page h2 {
  margin: 6px 0 14px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.playmode-construction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.playmode-construction-grid span,
.coming-soon-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(124, 231, 255, 0.24);
  background: rgba(124, 231, 255, 0.08);
  color: #dff8ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.playmode-construction-grid span {
  min-height: 42px;
  padding: 10px 12px;
}

.playmode-coming-soon-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(124, 231, 255, 0.2);
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 231, 255, 0.16), transparent 34%),
    rgba(255, 255, 255, 0.035);
}

.coming-soon-kicker {
  width: fit-content;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.coming-soon-button {
  width: fit-content;
  cursor: pointer;
}

.account-delete-modal-panel {
  border-color: rgba(255, 112, 112, 0.2);
  box-shadow: 0 26px 70px rgba(40, 7, 12, 0.45);
}

.account-delete-warning {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 118, 118, 0.22);
  background: linear-gradient(180deg, rgba(120, 18, 28, 0.22), rgba(255, 255, 255, 0.03));
}

.account-delete-warning strong {
  color: #ffd6d6;
  letter-spacing: 0.02em;
}

.account-delete-warning .hero-text {
  margin: 0;
}

.export-progress-modal-panel {
  width: min(560px, calc(100vw - 40px));
}

.playmode-invite-modal-panel {
  width: min(680px, calc(100vw - 40px));
}

.playmode-invite-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.playmode-invite-field input[readonly] {
  cursor: default;
}

.playmode-invite-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  max-height: min(380px, 48vh);
  overflow: auto;
  padding-right: 4px;
}

.playmode-invite-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(130, 220, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(56, 129, 183, 0.14), rgba(5, 18, 32, 0.74)),
    rgba(255, 255, 255, 0.03);
}

.playmode-invite-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(151, 230, 255, 0.35);
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.playmode-invite-user {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.playmode-invite-user strong,
.playmode-invite-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playmode-invite-user span,
.playmode-invite-empty {
  color: var(--muted);
}

.playmode-invite-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid rgba(156, 226, 255, 0.12);
}

.playtest-cinematic-shell {
  z-index: 2147483646;
  opacity: 0;
  transition: opacity 320ms ease;
}

.playtest-cinematic-shell.is-visible {
  opacity: 1;
}

.playtest-cinematic-shell.is-closing {
  opacity: 0;
}

.playtest-cinematic-backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
}

.playtest-cinematic-panel {
  position: relative;
  width: min(100vw, 100%);
  height: 100vh;
  display: grid;
  place-items: center;
}

.playtest-cinematic-video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 320ms ease, filter 320ms ease;
  filter: saturate(1.02);
}

.playtest-cinematic-shell.is-visible .playtest-cinematic-video {
  transform: scale(1);
}

.playtest-cinematic-shell.is-closing .playtest-cinematic-video {
  transform: scale(1.015);
  filter: saturate(0.92) brightness(0.92);
}

.export-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(171, 226, 255, 0.12);
}

.export-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.34), transparent 30%),
    linear-gradient(135deg, var(--accent-strong), var(--accent));
  transition: width 0.22s ease;
}

.export-progress-percent {
  margin: 8px 0 0;
  color: #dff8ff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-inline-status {
  margin: 0.35rem 0 0;
  min-height: 1.4rem;
}

.hero-actions,
.print-actions,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-search-row,
.explore-controls {
  display: grid;
  gap: 14px;
}

.explore-controls {
  grid-template-columns: minmax(180px, 220px) minmax(260px, 1fr) auto;
  align-items: end;
}

body[data-page="explore-decks"] .page-hero {
  padding: 18px;
}

body[data-page="cards"] .page-hero {
  padding: 18px;
}

body[data-page="explore-decks"] .explore-controls {
  width: 100%;
}

body[data-page="cards"] .explore-controls {
  width: 100%;
}

.explore-filter-actions {
  align-self: end;
}

.export-select-field {
  min-width: 190px;
}

.explore-type-field {
  min-width: 200px;
  align-self: end;
}

.deck-title-row {
  margin: 18px 0 8px;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(4, minmax(150px, 0.5fr)) auto;
  align-items: stretch;
  gap: 14px;
}

.deck-workspace-header {
  display: grid;
  gap: 12px;
}

.deck-workspace-title {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  color: #f7fcff;
  text-shadow: 0 12px 30px rgba(96, 190, 255, 0.14);
}

.deck-workspace-title:not(.is-read-only) {
  cursor: pointer;
}

.deck-workspace-title:not(.is-read-only):hover,
.deck-workspace-title:not(.is-read-only):focus-visible {
  color: #ffffff;
}

.workspace-control-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  align-items: flex-start;
}

.view-panel {
  min-width: min(100%, 620px);
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(157, 213, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.view-panel-dropdown {
  position: relative;
  min-width: 210px;
  width: auto;
}

.view-panel-toggle {
  width: 100%;
  justify-content: center;
}

.view-panel-dropdown[open] {
  z-index: 24;
}

.view-panel-dropdown:not([open]) {
  gap: 0;
  padding: 0;
  border: none;
  background: none;
}

.view-panel-dropdown:not([open]) .view-panel-grid {
  display: none;
}

.view-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.view-panel-dropdown[open] .view-panel-grid {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(620px, calc(100vw - 44px));
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(157, 213, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(18, 48, 78, 0.98), rgba(7, 17, 30, 0.98));
  box-shadow: 0 24px 52px rgba(1, 8, 18, 0.38);
}

.view-panel-grid > .field,
.view-panel-grid > button {
  min-width: 0;
}

.view-panel-grid > button {
  width: 100%;
  min-height: 86px;
  align-self: stretch;
  justify-content: center;
}

.deck-builder-toolbar {
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: minmax(320px, 1.7fr) minmax(210px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.deck-filter-dropdown {
  min-width: 210px;
  width: 100%;
}

.deck-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.deck-search-field,
.builder-filter-field,
.builder-cost-field {
  position: relative;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(157, 213, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(18, 44, 74, 0.34), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-height: 86px;
}

.deck-builder-toolbar > .field > span,
.view-panel > .section-label {
  margin: 0;
  color: #dcecff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
}

.builder-cost-field input[type="range"] {
  width: 100%;
  accent-color: #81d7ff;
}

.search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 10px);
  z-index: 14;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(157, 213, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(13, 34, 58, 0.98), rgba(8, 13, 22, 0.98));
  box-shadow: 0 22px 40px rgba(5, 10, 18, 0.3);
}

.search-suggestion-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(157, 213, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: #f7fcff;
  text-align: left;
}

.search-suggestion-item:hover,
.search-suggestion-item:focus-visible {
  border-color: rgba(157, 213, 255, 0.28);
  background: rgba(129, 215, 255, 0.08);
}

.search-suggestion-name {
  font-weight: 700;
  line-height: 1.15;
}

.search-suggestion-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.deck-title-field {
  min-width: 0;
}

.builder-sort-field {
  min-width: 170px;
}

.builder-visibility-field {
  min-width: 170px;
}

.builder-format-field {
  min-width: 210px;
}

.builder-view-field {
  min-width: 170px;
}

.deck-workspace .deck-title-row > .field {
  gap: 10px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(157, 213, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-height: 86px;
}

.deck-workspace {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(10, 22, 40, 0.96), rgba(7, 14, 26, 0.98));
}

.deck-workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--deck-cover-image, none);
  background-size: cover;
  background-position: center 24%;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.deck-workspace.has-deck-cover::before {
  opacity: 0.3;
}

.deck-workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 29, 54, 0.88) 0%, rgba(17, 49, 82, 0.76) 42%, rgba(10, 15, 27, 0.58) 100%),
    radial-gradient(circle at top left, rgba(111, 235, 255, 0.14), transparent 32%),
    radial-gradient(circle at top center, rgba(126, 168, 255, 0.12), transparent 28%);
  pointer-events: none;
}

.deck-workspace > * {
  position: relative;
  z-index: 2;
}

.workspace-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-workspace .deck-title-row > .field > span,
.deck-workspace .workspace-top .export-select-field > span,
.deck-workspace .workspace-top .workspace-format-field > span {
  margin: 0;
  color: #dcecff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
}

.deck-workspace .deck-title-row .small-button {
  align-self: stretch;
  min-height: 100%;
  padding-inline: 20px;
  border-radius: 20px;
}

.deck-workspace .workspace-top .hero-actions {
  align-items: stretch;
}

.deck-workspace .workspace-top .export-select-field,
.deck-workspace .workspace-top .workspace-format-field {
  min-width: 210px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(157, 213, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.deck-workspace .workspace-top .export-select-field > span,
.deck-workspace .workspace-top .workspace-format-field > span {
  margin-bottom: 8px;
}

.workspace-background-field {
  margin-top: 14px;
  max-width: 240px;
  gap: 8px;
}

.deck-workspace .workspace-top .workspace-background-field select {
  min-height: 44px;
}

.toggle-history-button.is-active,
#toggle-history-button.is-active {
  border-color: rgba(134, 234, 255, 0.34);
  background: rgba(113, 204, 255, 0.12);
  color: #f2fbff;
}

.deck-owner-panel {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 226, 255, 0.18);
  background:
    radial-gradient(circle at top left, rgba(128, 230, 255, 0.14), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 35%),
    rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 1px 0 rgba(244, 252, 255, 0.08),
    0 18px 36px rgba(14, 38, 68, 0.2);
}

.deck-owner-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background-color: rgba(255, 255, 255, 0.06);
}

.deck-owner-copy {
  display: grid;
  gap: 6px;
}

.deck-owner-copy strong {
  font-size: 1.08rem;
  letter-spacing: 0.03em;
}

.deck-owner-copy span {
  color: var(--muted);
  font-size: 0.88rem;
}

.deck-owner-actions {
  display: grid;
  gap: 10px;
  min-width: 180px;
}

.sandbox-launch-panel {
  display: grid;
  gap: 14px;
}

.sandbox-launch-copy {
  display: grid;
  gap: 14px;
  align-items: start;
}

.history-hero-panel {
  position: relative;
  overflow: hidden;
}

.history-hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(118, 226, 255, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(246, 205, 123, 0.14), transparent 38%);
  pointer-events: none;
}

.history-hero-panel > * {
  position: relative;
  z-index: 1;
}

.history-hero-header {
  align-items: start;
}

.playtest-hero-panel,
.playtest-board-panel {
  position: relative;
  overflow: hidden;
}

.playtest-hero-panel::before,
.playtest-board-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(118, 226, 255, 0.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(248, 205, 120, 0.12), transparent 38%);
  pointer-events: none;
}

.playtest-hero-panel > *,
.playtest-board-panel > * {
  position: relative;
  z-index: 1;
}

.playtest-hero-header {
  align-items: start;
}

.playtest-top-actions {
  display: flex;
  justify-content: flex-end;
}

.playtest-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
}

.playtest-battlefield-shell {
  display: grid;
  gap: 10px;
}

.playtest-battlefield-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #f7fcff;
  font-weight: 700;
}

.playtest-battlefield-header strong {
  font-size: 1rem;
}

.playtest-battlefield-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.playtest-battlefield {
  position: relative;
  min-height: 62vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(38, 40, 44, 0.92), rgba(28, 29, 32, 0.96));
  overflow: visible;
}

.playtest-battlefield-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.playtest-shield-strip,
.playtest-battle-zone-shell,
.playtest-mana-zone-shell,
.playtest-bottom-rail,
.playtest-hand-shell,
.playtest-side-zones,
.playtest-pile-shell {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.playtest-inline-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #f7fcff;
}

.playtest-inline-zone-header span {
  font-size: 0.92rem;
  font-weight: 700;
}

.playtest-inline-zone-header strong {
  color: #dcecff;
  font-size: 0.95rem;
}

.playtest-card-grid {
  display: grid;
  gap: 14px;
}

.playtest-card-grid-battle {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.playtest-inline-card-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
  position: relative;
  z-index: 5;
}

.playtest-inline-card-row > * {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.playtest-inline-card-row-hand > * {
  width: 215px;
}

.playtest-inline-card-row-shields > * {
  width: 168px;
}

.playtest-card {
  position: relative;
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 0;
  border-radius: 20px;
  border: none;
  background: transparent;
  transition: transform 180ms ease, border-color 180ms ease;
  justify-items: center;
}

.playtest-card:hover {
  transform: translateY(-1px);
}

.playtest-card.is-tapped {
  transform: rotate(90deg);
  transform-origin: center;
  margin: 34px 0;
}

.playtest-card-image-button {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.playtest-card-image,
.playtest-card-back {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.playtest-card-back {
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  color: transparent;
  border: 1px solid rgba(157, 213, 255, 0.18);
  background:
    radial-gradient(circle at top, rgba(123, 214, 255, 0.24), transparent 38%),
    linear-gradient(145deg, rgba(30, 49, 70, 0.94), rgba(7, 13, 21, 0.98));
}

.playtest-card-body {
  display: grid;
  gap: 12px;
}

.playtest-card-copy {
  display: grid;
  gap: 6px;
}

.playtest-card-copy strong {
  font-size: 1rem;
  line-height: 1.15;
}

.playtest-card-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.playtest-card-actions {
  display: none;
}

.playtest-pile-stack {
  position: relative;
  width: min(170px, 100%);
  aspect-ratio: 63 / 88;
  margin: 0;
}

.playtest-deck-stack-card,
.playtest-deck-stack-top {
  position: absolute;
  inset: 0;
  border-radius: 18px;
}

.playtest-deck-stack-card:nth-child(1) {
  transform: translate(12px, 12px);
  border: 1px solid rgba(157, 213, 255, 0.18);
  background: rgba(12, 20, 31, 0.82);
}

.playtest-deck-stack-card:nth-child(2) {
  transform: translate(6px, 6px);
  border: 1px solid rgba(157, 213, 255, 0.18);
  background: rgba(17, 28, 41, 0.88);
}

.playtest-deck-stack-top {
  display: grid;
  place-items: center;
  border: 1px solid rgba(157, 213, 255, 0.22);
  background:
    radial-gradient(circle at top, rgba(123, 214, 255, 0.24), transparent 38%),
    linear-gradient(145deg, rgba(33, 57, 82, 0.96), rgba(8, 13, 21, 0.98));
  color: #f7fcff;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  box-shadow: 0 18px 34px rgba(4, 11, 18, 0.28);
}

.playtest-pile-meta {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  text-align: left;
}

.playtest-pile-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.playtest-pile-actions .small-button {
  flex: 1 1 0;
}

.playtest-pile-meta span {
  color: var(--muted);
  font-size: 0.86rem;
}

.playtest-empty-state {
  padding: 28px 0 4px;
}

.playtest-zone-empty {
  margin: 0;
}

.playtest-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
}

.playtest-side-button {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 173, 96, 0.55);
  background: linear-gradient(180deg, rgba(248, 164, 90, 0.95), rgba(201, 97, 42, 0.95));
  color: #fffaf4;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(240, 122, 52, 0.2);
}

.playtest-side-button-primary {
  border-color: rgba(255, 205, 132, 0.75);
  background: linear-gradient(180deg, rgba(255, 189, 94, 1), rgba(219, 111, 45, 0.98));
}

.playtest-turn-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(129, 215, 255, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.playtest-turn-panel span {
  color: #dcecff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.playtest-turn-actions {
  display: grid;
  gap: 8px;
}

.playtest-turn-input {
  min-height: 44px;
  text-align: center;
  font-weight: 700;
}

.playtest-bottom-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  margin-top: 8px;
}

.playtest-hand-shell,
.playtest-side-zones {
  min-height: 182px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(27, 28, 31, 0.88);
}

.playtest-side-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.playtest-mini-zone {
  min-height: 238px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(157, 213, 255, 0.12);
  background: rgba(9, 14, 22, 0.65);
  display: grid;
  gap: 10px;
}

.playtest-cover-panel {
  padding: 0;
  overflow: hidden;
  min-height: 332px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  background:
    linear-gradient(120deg, rgba(105, 22, 143, 0.88), rgba(53, 15, 88, 0.72) 42%, rgba(82, 42, 57, 0.56)),
    var(--playtest-cover-image, radial-gradient(circle at center, rgba(255,255,255,0.12), transparent 60%));
  background-size: cover;
  background-position: center;
}

body[data-page="playtest"] .top-nav {
  display: none;
}

body[data-page="playtest"] .page-shell {
  width: min(100%, 100%);
  padding: 0;
}

body[data-page="playtest"] {
  background:
    radial-gradient(circle at 18% 12%, rgba(111, 235, 255, 0.12), transparent 22%),
    radial-gradient(circle at 86% 10%, rgba(126, 168, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #040a12 0%, #08111c 42%, #060d17 100%);
}

body[data-page="playtest"]::before {
  background:
    linear-gradient(125deg, transparent 0 38%, rgba(255, 255, 255, 0.02) 45%, transparent 52%),
    linear-gradient(215deg, transparent 0 48%, rgba(126, 168, 255, 0.04) 54%, transparent 60%);
}

body[data-page="playtest"]::after {
  background-image:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 16%, rgba(131, 235, 255, 0.08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 72%, rgba(126, 168, 255, 0.08) 0 1px, transparent 1.5px);
}

body[data-page="playtest"] .page-stack {
  gap: 0;
}

.playtest-cover-overlay {
  display: grid;
  gap: 18px;
  min-height: 332px;
  padding: 28px clamp(20px, 3vw, 34px) 34px;
  align-content: end;
  background:
    linear-gradient(180deg, rgba(11, 8, 20, 0.12), rgba(12, 8, 24, 0.78));
}

.playtest-cover-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.playtest-owner-label {
  color: rgba(242, 233, 255, 0.92);
  font-size: 0.98rem;
  font-weight: 700;
}

.playtest-back-link {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.playtest-stage-banner {
  min-height: 88px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(8, 8, 10, 0.98),
      rgba(8, 8, 10, 0.98) 28px,
      rgba(15, 15, 17, 0.98) 28px,
      rgba(15, 15, 17, 0.98) 56px
    );
}

.playtest-stage-banner-inner {
  width: 100%;
  height: 100%;
}

.playtest-cover-panel h1 {
  margin: 0;
  font-size: clamp(3rem, 5vw, 4.8rem);
  line-height: 0.96;
  color: #ffffff;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.playtest-cover-panel .hero-text {
  max-width: 960px;
  margin: 0;
  color: rgba(245, 240, 255, 0.92);
}

.playtest-cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playtest-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #faf4ff;
  font-size: 0.86rem;
  font-weight: 600;
}

.playtest-meta-pill strong {
  color: #ffffff;
}

.playtest-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 16px;
  align-items: center;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 18px clamp(20px, 3vw, 28px);
  background: rgba(35, 35, 37, 0.985);
}

.playtest-command-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playtest-command-tab {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(157, 213, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #cfc0e6;
  font-weight: 600;
}

.playtest-command-tab.is-active {
  border-color: rgba(192, 124, 255, 0.28);
  background: rgba(176, 103, 247, 0.12);
  color: #ffffff;
}

.playtest-command-search {
  display: flex;
  justify-content: flex-end;
}

.playtest-search-shell {
  position: relative;
  width: 100%;
}

.playtest-search-shell input {
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(199, 120, 255, 0.32);
  background: rgba(18, 14, 28, 0.9);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(132, 76, 188, 0.12);
}

.playtest-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 18;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(199, 120, 255, 0.22);
  background: rgba(21, 16, 31, 0.98);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.35);
}

.playtest-search-results-static {
  position: static;
  margin-top: 14px;
  max-height: 360px;
  overflow: auto;
}

.playtest-search-result {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  text-align: left;
}

.playtest-search-result:hover,
.playtest-search-result:focus-visible {
  border-color: rgba(199, 120, 255, 0.32);
  background: rgba(176, 103, 247, 0.12);
}

.playtest-search-result strong {
  font-size: 0.98rem;
}

.playtest-search-result span {
  color: #cdbde4;
  font-size: 0.82rem;
}

.playtest-graveyard-result small {
  width: fit-content;
  border: 1px solid rgba(129, 215, 255, 0.24);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(129, 215, 255, 0.08);
  color: #dff8ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.playtest-board-panel {
  padding: 0 clamp(20px, 3vw, 28px) 24px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  background: linear-gradient(180deg, rgba(7, 17, 29, 0.995), rgba(6, 13, 23, 0.995));
}

.playtest-board-panel-clean {
  min-height: 100vh;
  padding-top: 16px;
}

.playtest-inline-status {
  margin: 0 0 12px;
  min-height: 24px;
}

.playtest-table {
  grid-template-columns: 1fr;
  gap: 12px;
}

.playtest-battlefield {
  min-height: 60vh;
  padding: 10px 18px 16px;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(9, 20, 34, 0.995), rgba(7, 16, 28, 0.995));
}

.playtest-battlefield-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
}

.playtest-battlefield-header,
.playtest-inline-zone-header {
  color: #f2f2f3;
}

.playtest-battlefield-shell {
  position: relative;
}

.playtest-inline-zone-header span {
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

.playtest-shield-strip {
  padding-right: 164px;
}

.playtest-battle-zone-shell,
.playtest-mana-zone-shell {
  padding-right: 164px;
}

.playtest-inline-card-row-shields > * {
  width: 126px;
}

.playtest-sidebar {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  width: min(142px, calc(100vw - 32px));
  display: grid;
  align-content: start;
  gap: 10px;
}

.playtest-side-button {
  min-height: 46px;
  padding-inline: 14px;
}

.playtest-turn-panel {
  background: transparent;
  border: none;
  padding: 0;
}

.playtest-bottom-rail {
  grid-template-columns: minmax(0, 1fr) 332px;
  gap: 18px;
  margin-top: 0;
}

.playtest-hand-shell,
.playtest-side-zones {
  border-radius: 0 0 18px 18px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(36, 36, 38, 0.985);
}

.playtest-hand-shell {
  min-height: 188px;
}

.playtest-inline-card-row-hand > * {
  width: 168px;
}

.playtest-pile-shell {
  min-height: 100%;
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 27, 0.92);
}

.playtest-mini-zone {
  min-height: 216px;
}

.playtest-inline-zone-header strong {
  color: #cfcfd4;
}

.playtest-shield-strip,
.playtest-mana-zone-shell,
.playtest-hand-shell,
.playtest-side-zones {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
}

.playtest-battle-zone-shell {
  padding: 4px 0 6px;
}

.playtest-inline-card-row-hand > * {
  width: 188px;
}

.playtest-inline-card-row-shields > * {
  width: 126px;
}

.playtest-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  border: none;
  justify-items: center;
  z-index: 1;
}

.playtest-card.is-selected {
  z-index: 200;
}

.playtest-card.is-selected .playtest-card-image,
.playtest-card.is-selected .playtest-card-back {
  box-shadow:
    0 0 0 2px rgba(129, 215, 255, 0.55),
    0 18px 30px rgba(2, 8, 16, 0.34);
}

.playtest-card.is-evolution-target .playtest-card-image,
.playtest-card.is-evolution-target .playtest-card-back {
  box-shadow:
    0 0 0 3px rgba(255, 214, 94, 0.72),
    0 18px 30px rgba(2, 8, 16, 0.38);
}

.playtest-card.is-tapped {
  transform: none;
  margin: 0;
}

.playtest-card.is-tapped .playtest-card-image,
.playtest-card.is-tapped .playtest-card-back {
  transform: rotate(90deg);
  transform-origin: center;
}

.playtest-card.is-mana-card .playtest-card-image,
.playtest-card.is-mana-card .playtest-card-back {
  transform: rotate(180deg);
  transform-origin: center;
}

.playtest-card.is-mana-card.is-tapped .playtest-card-image,
.playtest-card.is-mana-card.is-tapped .playtest-card-back {
  transform: rotate(270deg);
}

.playtest-card-image-button {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.playtest-card-image,
.playtest-card-back {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.playtest-inline-card-row-hand > * {
  width: 150px;
}

.playtest-inline-card-row-shields > * {
  width: 118px;
}

.playtest-card-grid-battle {
  grid-template-columns: repeat(auto-fit, minmax(132px, max-content));
  gap: 16px;
}

.playtest-action-overlay {
  position: fixed !important;
  z-index: 2147483647 !important;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 168px;
  pointer-events: auto;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(129, 215, 255, 0.24);
  background: rgba(7, 16, 29, 0.96);
  box-shadow: 0 22px 44px rgba(2, 8, 16, 0.48);
  backdrop-filter: blur(12px);
}

.playtest-action-overlay.is-below {
  transform: translateX(-50%);
}

.playtest-action-overlay .small-button {
  min-height: 38px;
  padding: 8px 12px;
  width: 100%;
  display: block;
  color: #f3fbff;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 34%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(129, 215, 255, 0.18);
  box-shadow: none;
  transform: none !important;
}

body[data-page="playtest"] .playtest-card,
body[data-page="playtest"] .playtest-battlefield,
body[data-page="playtest"] .playtest-bottom-rail,
body[data-page="playtest"] .playtest-side-zones,
body[data-page="playtest"] .playtest-hand-shell,
body[data-page="playtest"] .playtest-shield-strip,
body[data-page="playtest"] .playtest-mana-zone-shell,
body[data-page="playtest"] .playtest-battle-zone-shell {
  isolation: auto;
}

.playtest-pile-shell,
.playtest-hand-shell,
.playtest-side-zones,
.playtest-shield-strip,
.playtest-mana-zone-shell {
  background: rgba(255, 255, 255, 0.018);
}

.playtest-deck-stack-top {
  background:
    radial-gradient(circle at top, rgba(123, 214, 255, 0.22), transparent 38%),
    linear-gradient(145deg, rgba(20, 45, 72, 0.96), rgba(8, 13, 21, 0.98));
}

.playtest-side-button {
  border-color: rgba(126, 177, 255, 0.55);
  background: linear-gradient(180deg, rgba(65, 117, 214, 0.98), rgba(27, 72, 146, 0.98));
  box-shadow: 0 0 16px rgba(63, 127, 226, 0.18);
}

.playtest-side-button-primary {
  border-color: rgba(131, 235, 255, 0.7);
  background: linear-gradient(180deg, rgba(97, 193, 255, 0.98), rgba(47, 103, 192, 0.98));
  box-shadow: 0 0 18px rgba(77, 161, 255, 0.24);
}

.playtest-turn-panel {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.playtest-pile-zone {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  min-height: 236px;
}

.playtest-bottom-rail {
  grid-template-columns: minmax(0, 1fr) 388px;
}

.playtest-side-zones {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr);
  align-items: start;
}

.playtest-pile-shell {
  min-width: 0;
}

.playtest-inline-card-row,
.playtest-card-grid,
.playtest-pile-zone,
.playtest-mini-zone,
.playtest-pile-shell,
.playtest-hand-shell,
.playtest-side-zones,
.playtest-shield-strip,
.playtest-mana-zone-shell {
  overflow: visible;
}

.playtest-inline-card-row-hand,
.playtest-inline-card-row-shields {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.playtest-inline-card-row-shields > * {
  width: 84px;
}

.playtest-inline-card-row > * {
  width: 104px;
}

.playtest-inline-card-row-hand > * {
  width: 112px;
}

.playtest-card-grid-battle {
  grid-template-columns: repeat(auto-fit, minmax(104px, max-content));
  gap: 12px;
}

.playtest-pile-zone .playtest-deck-stack {
  position: relative;
  width: 94px;
  aspect-ratio: 63 / 88;
  margin: 0 auto;
}

.playtest-pile-zone .playtest-deck-stack-card,
.playtest-pile-zone .playtest-deck-stack-top,
.playtest-card-back {
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

.playtest-pile-zone .playtest-deck-stack-card,
.playtest-pile-zone .playtest-deck-stack-top {
  border-radius: 16px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3);
}

.playtest-pile-zone .playtest-deck-stack-card:nth-child(1) {
  transform: translate(10px, 10px);
}

.playtest-pile-zone .playtest-deck-stack-card:nth-child(2) {
  transform: translate(5px, 5px);
}

.playtest-pile-zone .playtest-deck-stack-top::after,
.playtest-card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(6, 14, 28, 0.16), rgba(6, 14, 28, 0.42));
  pointer-events: none;
}

.playtest-card-back {
  position: relative;
  overflow: hidden;
}

.playtest-card-back-image,
.playtest-deck-stack-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 320px;
  gap: 18px;
  margin-top: 14px;
}

body[data-page="playtest"] {
  --playtest-card-size: 112px;
}

body[data-page="playtest"] .playtest-card,
body[data-page="playtest"] .playtest-inline-card-row > .playtest-card,
body[data-page="playtest"] .playtest-card-grid-battle > .playtest-card {
  width: var(--playtest-card-size);
}

body[data-page="playtest"] .playtest-card-image-button {
  display: block;
  width: 100%;
}

body[data-page="playtest"] .playtest-card-image,
body[data-page="playtest"] .playtest-card-back {
  width: 100%;
}

body[data-page="playtest"] .playtest-card.has-underlays .playtest-card-image-button {
  position: relative;
}

body[data-page="playtest"] .playtest-card.has-underlays .playtest-card-image-button::before,
body[data-page="playtest"] .playtest-card.has-underlays .playtest-card-image-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(7, 16, 29, 0.28);
  border: 1px solid rgba(129, 215, 255, 0.12);
  z-index: -1;
}

body[data-page="playtest"] .playtest-card.has-underlays .playtest-card-image-button::before {
  transform: translate(5px, 5px);
}

body[data-page="playtest"] .playtest-card.has-underlays .playtest-card-image-button::after {
  transform: translate(10px, 10px);
}

.playtest-stack-badge {
  position: absolute;
  right: -8px;
  top: -8px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #f3fbff;
  background: linear-gradient(180deg, rgba(97, 193, 255, 0.98), rgba(47, 103, 192, 0.98));
  box-shadow: 0 8px 18px rgba(2, 8, 16, 0.32);
  z-index: 3;
}

.playtest-graveyard-stack {
  position: relative;
  display: grid;
  grid-template-columns: var(--playtest-card-size) minmax(84px, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: calc(var(--playtest-card-size) * 1.4);
  padding: 8px 6px 8px 2px;
}

.playtest-graveyard-stack .playtest-card {
  position: relative;
  z-index: 2;
}

.playtest-graveyard-stack::before,
.playtest-graveyard-stack::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  width: var(--playtest-card-size);
  aspect-ratio: 5 / 7;
  border-radius: 16px;
  border: 1px solid rgba(129, 215, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(7, 18, 32, 0.78), rgba(15, 31, 49, 0.88)),
    rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.playtest-graveyard-stack::before {
  transform: translate(8px, 8px);
  z-index: 0;
}

.playtest-graveyard-stack::after {
  transform: translate(16px, 16px);
  z-index: 0;
  opacity: 0.72;
}

.playtest-graveyard-stack-meta {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(129, 215, 255, 0.2);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(6, 18, 31, 0.78);
  color: #dff8ff;
  box-shadow: 0 14px 30px rgba(0, 8, 18, 0.34);
}

.playtest-graveyard-stack-meta strong {
  color: #fff0a8;
  font-size: 1.05rem;
}

.playtest-graveyard-stack-meta span {
  color: rgba(223, 248, 255, 0.72);
  font-size: 0.76rem;
  line-height: 1.25;
}

body[data-page="playtest"] .playtest-inline-card-row-hand > *,
body[data-page="playtest"] .playtest-inline-card-row-shields > * {
  width: var(--playtest-card-size);
}

body[data-page="playtest"] .playtest-card-grid-battle {
  grid-template-columns: repeat(auto-fit, minmax(var(--playtest-card-size), max-content));
  gap: 12px;
}

body[data-page="playtest"] .playtest-pile-zone .playtest-deck-stack {
  width: var(--playtest-card-size);
}

.workspace-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.builder-board {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.builder-main-column,
.builder-side-column {
  display: grid;
  gap: 22px;
}

.builder-surface {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(173, 215, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(13, 32, 56, 0.42), rgba(9, 15, 27, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.builder-surface-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.builder-surface-header:empty {
  display: none;
}

.builder-surface-header h2 {
  font-size: 1.35rem;
}

.builder-surface .section-label {
  margin-bottom: 6px;
}

.builder-deck-surface {
  min-height: 420px;
}

.builder-catalog-surface,
.builder-deck-surface {
  gap: 14px;
}

.builder-catalog-surface {
  background:
    radial-gradient(circle at top left, rgba(111, 235, 255, 0.1), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 32%),
    linear-gradient(180deg, rgba(10, 25, 44, 0.88), rgba(10, 16, 25, 0.92));
}

.builder-stats-panel {
  display: grid;
  gap: 18px;
}

.builder-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.builder-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.text-import-grid {
  display: grid;
  gap: 14px;
}

textarea {
  width: 100%;
  border: 1px solid rgba(180, 215, 255, 0.12);
  border-radius: 14px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  resize: vertical;
}

.profile-bio-editor-field {
  align-content: start;
}

.profile-bio-editor-field textarea {
  min-height: 136px;
  line-height: 1.55;
}

.profile-bio-editor-field .primary-button {
  justify-self: start;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

input[type="range"] {
  width: 100%;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.card-of-day-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 222, 118, 0.38);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 222, 118, 0.16), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(124, 231, 255, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(6, 27, 48, 0.92), rgba(7, 14, 26, 0.94));
}

.card-of-day-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 222, 118, 0.28);
  border-radius: 24px;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 22px 46px rgba(0, 12, 26, 0.22);
}

.card-of-day-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.card-of-day-art {
  border-radius: 18px;
  padding: 8px;
  background:
    radial-gradient(circle at top, rgba(255, 222, 118, 0.22), transparent 58%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 222, 118, 0.24);
}

.card-of-day-art img {
  width: 100%;
  display: block;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 12, 26, 0.38);
}

.card-of-day-copy {
  display: grid;
  gap: 8px;
}

.card-of-day-badge {
  justify-self: start;
}

.card-of-day-copy h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.95;
}

.card-of-day-type,
.card-of-day-rules {
  margin: 0;
  color: var(--muted);
}

.card-of-day-rules {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-height: 1.6;
}

.card-of-day-actions {
  margin-top: 8px;
}

.selected-search-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(157, 213, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 36%),
    linear-gradient(180deg, rgba(14, 36, 60, 0.68), rgba(9, 15, 25, 0.88));
}

.selected-search-card-art {
  width: 126px;
  aspect-ratio: 63 / 88;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.selected-search-card-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.selected-search-card-copy {
  display: grid;
  gap: 8px;
  align-content: start;
}

.selected-search-card-copy strong {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #f6fbff;
}

.selected-search-card-copy span {
  color: #d6e8fb;
  font-size: 0.85rem;
}

.selected-search-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.selected-search-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.card-item {
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 32%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: grid;
}

.card-item.is-clickable,
.deck-image-card.is-clickable,
.deck-row.is-clickable {
  cursor: pointer;
}

.card-item.is-clickable:focus-visible,
.deck-image-card.is-clickable:focus-visible,
.deck-row.is-clickable:focus-visible {
  outline: 2px solid rgba(132, 241, 255, 0.72);
  outline-offset: 2px;
}

.card-art {
  min-height: 148px;
  background:
    linear-gradient(135deg, rgba(94, 125, 255, 0.62), rgba(111, 235, 255, 0.62)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.34), transparent 36%),
    linear-gradient(210deg, transparent 0 48%, rgba(255, 255, 255, 0.12) 55%, transparent 62%);
}

.card-body {
  padding: 16px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-name {
  margin-bottom: 6px;
}

.card-type {
  margin: 0 0 8px;
  color: #a9f1de;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-rules {
  margin: 0;
  min-height: 72px;
  font-size: 0.92rem;
}

.add-button,
.primary-button,
.ghost-button,
.small-button,
.danger-button {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.add-button:hover,
.primary-button:hover,
.ghost-button:hover,
.small-button:hover,
.danger-button:hover,
.profile-deck-card:hover {
  transform: translateY(-1px);
}

.add-button,
.primary-button {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #071018;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(103, 196, 255, 0.18);
}

.ghost-button,
.small-button {
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 34%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.danger-button {
  color: #fff2f4;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(135deg, #ff6e84, #d92c4f);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(190, 34, 70, 0.24);
}

#follow-profile-button.primary-button,
#follow-profile-button.danger-button,
#deck-owner-follow-button.primary-button,
#deck-owner-follow-button.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  min-height: 46px;
  text-align: center;
}

#follow-profile-button.is-unfollow,
#deck-owner-follow-button.is-unfollow {
  border: 1px solid rgba(255, 124, 124, 0.72) !important;
  background: linear-gradient(180deg, rgba(236, 86, 86, 0.98), rgba(143, 26, 26, 0.98)) !important;
  color: #fff5f5 !important;
  box-shadow: 0 0 22px rgba(190, 34, 34, 0.28) !important;
}

#follow-profile-button.is-unfollow:hover,
#follow-profile-button.is-unfollow:focus-visible,
#deck-owner-follow-button.is-unfollow:hover,
#deck-owner-follow-button.is-unfollow:focus-visible {
  border-color: rgba(255, 167, 167, 0.82) !important;
  background: linear-gradient(180deg, rgba(248, 109, 109, 1), rgba(168, 34, 34, 1)) !important;
}

.profile-deck-actions .danger-button.profile-inline-button {
  color: #ffe6ea;
  border-color: rgba(255, 130, 150, 0.3);
  background:
    radial-gradient(circle at top, rgba(255, 182, 198, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(138, 26, 45, 0.78), rgba(88, 14, 30, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 232, 0.12),
    0 12px 24px rgba(76, 8, 20, 0.32);
}

.profile-deck-actions .danger-button.profile-inline-button:hover {
  color: #fff4f6;
  border-color: rgba(255, 168, 184, 0.46);
  background:
    radial-gradient(circle at top, rgba(255, 205, 217, 0.22), transparent 58%),
    linear-gradient(180deg, rgba(164, 34, 56, 0.88), rgba(100, 18, 35, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 239, 0.14),
    0 16px 28px rgba(86, 10, 24, 0.36);
}

.like-button.profile-inline-button {
  color: #eafcff;
  border-color: rgba(109, 223, 255, 0.28);
  background:
    radial-gradient(circle at top, rgba(151, 247, 255, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(37, 88, 120, 0.78), rgba(21, 49, 79, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(230, 251, 255, 0.12),
    0 12px 24px rgba(22, 71, 116, 0.28);
}

.like-button.profile-inline-button:hover,
.like-button.profile-inline-button:focus-visible {
  border-color: rgba(149, 240, 255, 0.42);
  background:
    radial-gradient(circle at top, rgba(173, 248, 255, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(43, 104, 140, 0.84), rgba(23, 58, 92, 0.98));
}

.like-button.is-liked.profile-inline-button {
  color: #f8ffff;
  border-color: rgba(151, 255, 251, 0.44);
  background:
    radial-gradient(circle at top, rgba(176, 255, 250, 0.26), transparent 58%),
    linear-gradient(180deg, rgba(51, 132, 138, 0.88), rgba(28, 79, 85, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(238, 255, 255, 0.16),
    0 14px 26px rgba(20, 88, 92, 0.34);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.deck-list {
  display: grid;
  gap: 10px;
  max-height: 900px;
  overflow: auto;
  padding-right: 4px;
}

.deck-list-image-mode {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  max-height: none;
  overflow: visible;
}

.deck-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 34%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.deck-row.has-copy-warning,
.deck-image-card.has-copy-warning {
  border-color: rgba(255, 85, 85, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 85, 85, 0.12),
    0 18px 34px rgba(120, 18, 28, 0.16);
}

.deck-copy-warning {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px 6px 7px;
  border-radius: 999px;
  color: #ffd8d8;
  background:
    linear-gradient(135deg, rgba(255, 76, 76, 0.2), rgba(120, 16, 34, 0.82)),
    rgba(80, 8, 16, 0.82);
  border: 1px solid rgba(255, 108, 108, 0.62);
  box-shadow: 0 10px 26px rgba(255, 40, 64, 0.18);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.deck-copy-warning-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #fff;
  background: #ff3434;
  box-shadow: 0 0 18px rgba(255, 52, 52, 0.55);
  font-size: 0.78rem;
  font-weight: 900;
}

.deck-image-card > .deck-copy-warning {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 18px;
  max-width: calc(100% - 78px);
}

.deck-row.is-clickable:hover,
.deck-image-card.is-clickable:hover,
.card-item.is-clickable:hover {
  box-shadow: 0 18px 34px rgba(56, 117, 168, 0.18);
}

.deck-row-main {
  display: grid;
  gap: 4px;
}

.deck-row-name,
.deck-image-name {
  letter-spacing: 0.02em;
  text-shadow: 0 6px 18px rgba(126, 168, 255, 0.08);
}

.deck-image-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 34%),
    rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.deck-image-art {
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.deck-image-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.deck-image-quantity {
  position: absolute;
  top: 20px;
  right: 20px;
  min-width: 42px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(7, 16, 24, 0.82);
  border: 1px solid rgba(180, 220, 255, 0.18);
  font-weight: 700;
}

.deck-image-meta {
  display: grid;
  gap: 4px;
}

.deck-image-meta span,
.deck-image-meta small {
  color: var(--muted);
}

.deck-image-actions {
  display: flex;
  gap: 8px;
}

.card-detail-hero {
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(164, 247, 255, 0.18), transparent 32%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.09), transparent 36%),
    rgba(255, 255, 255, 0.04);
}

.card-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.card-detail-visual {
  position: sticky;
  top: 24px;
}

.card-detail-frame {
  padding: 16px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(177, 255, 253, 0.14), transparent 56%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 36%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(181, 219, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 48px rgba(4, 15, 32, 0.28);
}

.card-detail-frame img {
  width: 100%;
  display: block;
  border-radius: 20px;
  box-shadow: 0 24px 40px rgba(4, 12, 26, 0.4);
}

.card-detail-copy {
  display: grid;
  gap: 20px;
}

.card-detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.card-detail-cost-badge {
  min-width: 76px;
  min-height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  font-weight: 700;
  color: #071018;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.42), transparent 52%),
    linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 16px 30px rgba(103, 196, 255, 0.22);
}

.card-detail-civs {
  gap: 10px;
}

.card-detail-animation-slot {
  display: flex;
  justify-content: flex-start;
}

.card-animation-button {
  box-shadow:
    0 18px 34px rgba(103, 196, 255, 0.18),
    0 0 24px rgba(255, 222, 118, 0.12);
}

.card-detail-info-grid,
.card-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card-detail-info-card,
.card-detail-meta-card {
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(176, 214, 255, 0.14);
  display: grid;
  gap: 6px;
}

.card-detail-info-label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-set-link {
  color: #c6f5ff;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 231, 255, 0.42);
}

.card-set-link:hover {
  color: #fff0a8;
  border-bottom-color: rgba(255, 222, 118, 0.7);
}

.card-detail-text-block {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(181, 219, 255, 0.14);
}

.card-detail-rules,
.card-detail-flavor {
  margin: 0;
  white-space: pre-line;
  line-height: 1.68;
}

.card-detail-flavor {
  color: #d9f7f2;
  font-style: italic;
}

.card-detail-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
}

@media (max-width: 900px) {
  .card-of-day-card {
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  }

  .playmode-construction-grid {
    grid-template-columns: 1fr;
  }

  .playmode-construction-panel .hero-actions {
    align-items: stretch;
  }

  .playmode-construction-panel .hero-actions > * {
    width: 100%;
    justify-content: center;
  }

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

  .card-detail-visual {
    position: static;
  }
}

@media (max-width: 640px) {
  .card-of-day-card {
    grid-template-columns: 1fr;
  }

  .card-of-day-art {
    width: min(220px, 100%);
    margin: 0 auto;
  }

  .card-of-day-actions {
    align-items: stretch;
  }

  .card-of-day-actions > * {
    width: 100%;
    justify-content: center;
  }

  .card-detail-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .card-detail-cost-badge {
    min-width: 64px;
    min-height: 64px;
    font-size: 1.35rem;
  }

  .card-detail-info-grid,
  .card-detail-meta-grid {
    grid-template-columns: 1fr;
  }
}

.deck-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-card {
  padding: 16px;
}

.chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(111, 212, 255, 0.08);
  border: 1px solid rgba(111, 212, 255, 0.14);
  font-size: 0.74rem;
  line-height: 1.1;
}

.mana-curve {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  gap: 6px;
  align-items: end;
  width: 100%;
  overflow: hidden;
}

.curve-bar {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
}

.curve-bar small {
  font-size: 0.68rem;
  color: #d7e9fb;
}

.curve-bar-fill {
  width: 100%;
  min-height: 8px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--accent), var(--violet));
}

.builder-stats-panel #civilization-breakdown {
  gap: 6px;
}

.builder-stats-panel .summary-card {
  overflow: hidden;
}

.print-pages {
  display: grid;
  gap: 24px;
  justify-items: center;
}

.print-page {
  background: white;
  border-radius: 18px;
  padding: 16.5mm 10.5mm;
  display: grid;
  grid-template-columns: repeat(3, var(--card-width-mm));
  grid-template-rows: repeat(3, var(--card-height-mm));
  gap: 0;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  justify-content: center;
  align-content: start;
}

.print-card {
  width: var(--card-width-mm);
  height: var(--card-height-mm);
  aspect-ratio: 63 / 88;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: white;
}

.print-card img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.print-card-fallback {
  background:
    linear-gradient(180deg, rgba(117, 147, 255, 0.06), rgba(111, 212, 255, 0.03)),
    white;
}

.print-card-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(90, 113, 255, 0.08), rgba(111, 212, 255, 0.05)),
    white;
}

@media (max-width: 1180px) {
  .deck-title-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-layout,
  .builder-board,
  .workspace-grid,
  .builder-bottom-grid,
  .hero,
  .page-hero,
  .explore-controls {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .deck-title-row {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 18px, 100%);
    padding-top: 18px;
  }

  .panel,
  .hero,
  .page-hero,
  .welcome-hero {
    padding: 18px;
    border-radius: 20px;
  }

  .top-nav {
    align-items: stretch;
  }

  .top-nav-links {
    width: 100%;
  }

  .menu-logo-link {
    width: 58px;
    height: 58px;
    max-width: none;
    padding: 0;
  }

  .menu-logo {
    width: 72%;
    height: 72%;
    transform: none;
    padding: 0;
  }

  .brand-lockup {
    grid-template-columns: 1fr;
  }

  .brand-mark-shell {
    width: 100px;
    height: 100px;
  }

  .brand-logo {
    width: 76px;
    height: 76px;
  }

  .filters,
  .profile-metrics,
  .builder-stat-cards,
  .print-page {
    grid-template-columns: 1fr;
  }

  .workspace-top,
  .deck-builder-toolbar,
  .builder-board {
    grid-template-columns: 1fr;
  }

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

  .selected-search-card-art {
    width: min(180px, 100%);
  }

  .workspace-control-stack {
    justify-items: stretch;
  }

  .builder-surface,
  .deck-workspace {
    padding: 18px;
  }

  .deck-workspace-title {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  .print-page {
    width: 100%;
    min-height: auto;
    padding: 0;
  }

  .print-card {
    width: 100%;
    height: auto;
    aspect-ratio: 63 / 88;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    background: white;
  }

  body {
    background: white;
  }

  .hero,
  .top-nav,
  .sidebar-stack,
  .catalog-panel,
  .quick-cards-panel,
  .print-control-panel,
  .print-actions,
  .print-copy {
    display: none;
  }

  .print-panel {
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    background: white;
  }

  .page-shell,
  .page-stack,
  .print-pages,
  .print-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .print-page {
    break-after: page;
    border: none;
    border-radius: 0;
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    padding: 16.5mm 10.5mm;
    gap: 0;
    margin: 0;
    page-break-inside: avoid;
    box-sizing: border-box;
  }

  .print-card {
    border: none;
  }
}

.legal-footer {
  display: grid;
  gap: 20px;
  margin-top: 22px;
  padding: 24px 28px;
}

.legal-footer-top {
  display: flex;
  justify-content: flex-start;
}

.legal-back-to-top {
  min-width: 0;
}

.legal-footer-copy {
  display: grid;
  gap: 12px;
}

.legal-footer-copy p,
.legal-footer-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(157, 213, 255, 0.14);
}

.discord-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 360px);
  padding: 9px 11px;
  border: 1px solid rgba(88, 101, 242, 0.34);
  border-radius: 18px;
  color: #eff4ff;
  text-decoration: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(124, 231, 255, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: 0 18px 36px rgba(4, 8, 22, 0.22);
}

.discord-footer-link .discord-icon {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  box-shadow: 0 0 8px rgba(88, 101, 242, 0.2);
}

.discord-footer-link .discord-icon svg {
  width: 11px;
  height: 11px;
}

.discord-footer-link:hover {
  border-color: rgba(139, 151, 255, 0.72);
  transform: translateY(-1px);
  box-shadow: 0 24px 46px rgba(88, 101, 242, 0.2);
}

.discord-footer-link span:not(.discord-icon) {
  display: grid;
  gap: 2px;
}

.discord-footer-link strong {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.discord-footer-link small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.discord-footer-panel {
  justify-items: start;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legal-footer-links a {
  color: #d9efff;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.legal-footer-links a:hover {
  color: var(--accent);
}

.legal-page {
  display: grid;
  gap: 22px;
  padding: 30px;
}

.legal-page-header {
  display: grid;
  gap: 10px;
}

.legal-page-header h1 {
  max-width: none;
}

.legal-section {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(157, 213, 255, 0.11);
}

.legal-section h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.legal-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.legal-section a {
  color: var(--accent);
  text-decoration: none;
}

.legal-section a:hover {
  color: #dff8ff;
}

.inline-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.admin-panel {
  display: grid;
  gap: 22px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-month-list {
  display: grid;
  gap: 10px;
}

.admin-month-row,
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(157, 213, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.admin-month-row-button {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.admin-month-row-button:hover,
.admin-month-row-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(157, 213, 255, 0.28);
  background: rgba(125, 208, 255, 0.08);
  box-shadow: 0 14px 26px rgba(4, 12, 24, 0.18);
}

.admin-month-row strong,
.admin-user-row strong {
  color: #f2fbff;
}

.admin-month-row span,
.admin-user-row p,
.admin-user-row small {
  margin: 0;
  color: var(--muted);
}

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

.admin-month-modal-panel {
  width: min(980px, calc(100vw - 28px));
}

.admin-month-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-month-detail-list {
  display: grid;
  gap: 12px;
}

.admin-month-detail-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(157, 213, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(6, 14, 29, 0.72);
}

.admin-month-detail-card strong {
  color: #f2fbff;
}

.admin-month-detail-card span,
.admin-month-detail-card small {
  margin: 0;
  color: var(--muted);
}

.cookie-consent-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12000;
  width: min(460px, calc(100vw - 36px));
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}

.cookie-consent-copy {
  display: grid;
  gap: 8px;
}

.cookie-consent-copy strong {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.cookie-consent-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 700px) {
  .legal-footer,
  .legal-page {
    padding: 22px 18px;
  }

  .legal-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .cookie-consent-banner {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .admin-two-column,
  .inline-field-row {
    grid-template-columns: 1fr;
  }
}


.contact-form-grid textarea {
  min-height: 160px;
  resize: vertical;
}

.notification-menu-header strong,
.admin-month-row strong {
  letter-spacing: 0.04em;
}


.card-art,
.deck-image-art,
.profile-deck-cover,
.profile-user-avatar,
.nav-avatar,
.avatar-preview-card,
.avatar-preset-art {
  background-repeat: no-repeat;
}

.catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

  .page-shell {
    padding: 14px;
    gap: 14px;
  }

  .top-nav {
    border-radius: 24px;
    padding: 12px;
    align-items: stretch;
  }

  .top-nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .menu-logo-link {
    align-self: center;
    margin: 0 auto 8px;
  }

  .nav-link,
  .nav-avatar-trigger,
  .nav-bell-trigger {
    min-height: 48px;
    justify-content: center;
  }

  .welcome-hero {
    padding: 28px 18px 24px;
    min-height: unset;
  }

  .welcome-logo {
    width: min(54vw, 220px);
  }

  .welcome-actions {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .welcome-actions .primary-button,
  .welcome-actions .ghost-button {
    width: 100%;
  }

  .page-hero,
  .welcome-hero,
  .panel {
    border-radius: 24px;
  }

  .create-profile-grid,
  .admin-two-column,
  .deck-title-row,
  .workspace-top {
    grid-template-columns: 1fr !important;
  }

  .deck-workspace {
    padding: 18px 14px;
  }

  .deck-list-image-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .deck-image-card {
    padding: 10px;
    border-radius: 18px;
  }

  .deck-image-art {
    min-height: 168px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-decks.compact-grid,
  .profile-decks {
    grid-template-columns: 1fr;
  }

  .profile-deck-card {
    min-height: 176px;
    padding: 14px;
  }

  .profile-deck-actions,
  .hero-actions {
    flex-wrap: wrap;
  }

  .nav-dropdown-menu {
    min-width: min(86vw, 320px);
  }
}

@media (max-width: 540px) {
  .top-nav-links {
    grid-template-columns: 1fr;
  }

  .playmode-invite-field,
  .playmode-invite-manual,
  .playmode-invite-row {
    grid-template-columns: 1fr;
  }

  .playmode-invite-row {
    justify-items: stretch;
  }

  .playmode-invite-avatar {
    justify-self: center;
  }

  .deck-list-image-mode {
    grid-template-columns: 1fr;
  }

  .page-hero h1,
  .welcome-hero h1 {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .hero-text {
    font-size: 0.96rem;
  }
}


@media (max-width: 820px) {
  body {
    overflow-x: hidden;
  }

  .page-shell {
    width: min(100% - 12px, 100%);
    padding-top: 12px;
    gap: 12px;
  }

  .panel,
  .hero,
  .page-hero,
  .welcome-hero,
  .deck-workspace,
  .profile-card,
  .admin-panel,
  .legal-footer,
  .legal-page {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
  }

  .menu-logo-link {
    width: 54px;
    height: 54px;
    margin: 0 auto;
  }

  .top-nav-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .nav-dropdown,
  .nav-link,
  .nav-login-link,
  .nav-logout-link,
  .nav-notification-dropdown,
  .nav-avatar-dropdown {
    width: 100%;
    margin-left: 0;
  }

  .nav-link,
  .nav-dropdown summary,
  .nav-avatar-trigger,
  .nav-bell-trigger {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .nav-dropdown-menu,
  .profile-dropdown-menu,
  .notification-dropdown-menu {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    max-height: none;
  }

  .welcome-hero {
    padding: 24px 14px 20px;
    gap: 12px;
  }

  .welcome-logo {
    width: min(52vw, 180px);
  }

  .welcome-actions,
  .builder-entry-actions,
  .builder-modify-actions,
  .hero-actions,
  .profile-deck-actions,
  .cookie-consent-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .welcome-actions .primary-button,
  .welcome-actions .ghost-button,
  .builder-entry-button,
  .hero-actions .primary-button,
  .hero-actions .danger-button,
  .hero-actions .ghost-button,
  .profile-inline-button,
  .cookie-consent-actions .primary-button,
  .cookie-consent-actions .ghost-button {
    width: 100%;
  }

  .create-profile-grid,
  .auth-grid,
  .admin-two-column,
  .deck-title-row,
  .deck-builder-toolbar,
  .workspace-top,
  .builder-bottom-grid,
  .builder-stat-cards,
  .profile-metrics,
  .filters,
  .explore-controls,
  .inline-field-row {
    grid-template-columns: 1fr !important;
  }

  .field input,
  .field select,
  .field textarea,
  button,
  .primary-button,
  .danger-button,
  .ghost-button,
  .nav-link {
    font-size: 16px;
  }

  .deck-list-image-mode,
  .catalog-grid,
  .profile-decks,
  .profile-decks.compact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .deck-image-card,
  .profile-deck-card {
    min-height: unset;
    padding: 12px;
  }

  .deck-image-art,
  .profile-deck-cover {
    min-height: 180px;
  }

  .modal-panel,
  .auth-modal-panel {
    width: min(100vw - 18px, 560px);
    max-height: calc(100vh - 20px);
    overflow: auto;
    padding: 18px 14px;
  }

  .notification-item.is-unread::before {
    left: 10px;
    top: 12px;
  }

  .notification-item {
    padding-left: 24px;
  }

  .workspace-control-stack {
    justify-items: stretch;
  }

  .view-panel-grid {
    grid-template-columns: 1fr;
  }

  .deck-filter-grid {
    grid-template-columns: 1fr;
  }

  .deck-workspace-title {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }

  .playtest-cover-overlay {
    padding: 24px 18px 26px;
  }

  .playtest-cover-panel h1 {
    font-size: clamp(2.4rem, 7vw, 3.4rem);
  }

  .playtest-stage-banner {
    min-height: 56px;
  }

  .playtest-command-panel {
    grid-template-columns: 1fr;
    padding: 16px 18px;
  }

  .playtest-command-search {
    justify-content: stretch;
  }

  .playtest-table {
    grid-template-columns: 1fr;
  }

  .playtest-sidebar {
    position: static;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: stretch;
  }

  .playtest-turn-panel {
    grid-column: 1 / -1;
  }

  .playtest-bottom-rail {
    grid-template-columns: 1fr;
  }

  .playtest-side-zones {
    grid-template-columns: 1fr 1fr;
  }

  .playtest-battlefield {
    min-height: 48vh;
  }

  .playtest-shield-strip,
  .playtest-battle-zone-shell,
  .playtest-mana-zone-shell {
    padding-right: 0;
  }

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

  .playtest-card {
    grid-template-columns: 92px 1fr;
  }

  .playtest-card.is-tapped {
    transform: none;
    margin: 0;
    border-color: rgba(129, 215, 255, 0.42);
    box-shadow: inset 0 0 0 1px rgba(129, 215, 255, 0.24);
  }
}

@media (max-width: 540px) {
  .page-shell {
    width: min(100% - 8px, 100%);
    padding-top: 8px;
  }

  .panel,
  .hero,
  .page-hero,
  .welcome-hero,
  .deck-workspace,
  .profile-card,
  .admin-panel,
  .legal-footer,
  .legal-page {
    padding: 16px 12px;
    border-radius: 18px;
  }

  .welcome-hero h1,
  .page-hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .section-label,
  .hero-text,
  .welcome-message,
  .legal-footer-copy p,
  .legal-footer-meta {
    font-size: 0.92rem;
  }

  .menu-logo-link,
  .nav-avatar,
  .nav-bell-trigger {
    width: 50px;
    height: 50px;
  }

  .playtest-cover-topline {
    align-items: start;
    flex-direction: column;
  }

  .playtest-cover-meta {
    gap: 8px;
  }

  .playtest-meta-pill {
    width: calc(50% - 4px);
    justify-content: space-between;
  }

  .playtest-sidebar {
    grid-template-columns: 1fr;
  }

  .playtest-side-zones {
    grid-template-columns: 1fr;
  }

  .playtest-command-tabs {
    gap: 8px;
  }

  .playtest-command-tab {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.92rem;
  }

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

  .playtest-card-image,
  .playtest-card-back {
    max-width: 180px;
    margin: 0 auto;
  }
}


.admin-dashboard-intro {
  padding: 20px 22px;
}

.admin-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-card-header .hero-text {
  max-width: 340px;
  margin: 0;
}

.admin-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.admin-stat-grid .stat-card {
  padding: 20px 18px;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.09), transparent 32%),
    linear-gradient(180deg, rgba(14, 23, 35, 0.92), rgba(8, 13, 22, 0.92));
}

.admin-stat-grid .stat-card strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
  color: #f5fcff;
}

.admin-email-diagnostics {
  display: grid;
  gap: 10px;
}

.admin-email-send-card .create-profile-grid,
.admin-notify-card .create-profile-grid {
  align-items: start;
}

.admin-email-send-card textarea,
.admin-notify-card textarea {
  min-height: 130px;
}

.admin-email-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(157, 213, 255, 0.12);
  background: rgba(255,255,255,0.03);
}

.admin-email-row strong {
  color: #f1fbff;
  letter-spacing: 0.04em;
}

.admin-email-row span {
  color: var(--muted);
  word-break: break-word;
}

.admin-email-error {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(157, 213, 255, 0.14);
  background: rgba(255,255,255,0.025);
  color: var(--muted);
  line-height: 1.6;
}

.admin-email-error.is-visible {
  border-style: solid;
  border-color: rgba(255, 129, 129, 0.28);
  background: linear-gradient(180deg, rgba(120, 30, 30, 0.22), rgba(80, 18, 18, 0.16));
  color: #ffd6d6;
}

.admin-user-list {
  gap: 14px;
}

.admin-user-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
}

.admin-user-copy {
  display: grid;
  gap: 6px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-user-actions .primary-button,
.admin-user-actions .ghost-button,
.admin-user-actions .danger-button {
  min-width: 120px;
}

.admin-contact-inbox,
.admin-audit-log {
  display: grid;
  gap: 12px;
}

.admin-message-card,
.admin-audit-entry {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(157, 213, 255, 0.12);
  background:
    linear-gradient(155deg, rgba(255,255,255,0.08), transparent 28%),
    rgba(255,255,255,0.035);
}

.admin-message-head,
.admin-audit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.admin-message-head strong,
.admin-audit-head strong {
  color: #f5fcff;
}

.admin-message-head span,
.admin-audit-head span,
.admin-message-meta,
.admin-audit-detail {
  color: var(--muted);
}

.admin-message-meta,
.admin-message-body,
.admin-audit-detail {
  margin: 0;
  line-height: 1.7;
}

.admin-message-body {
  color: #d8e8ff;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .admin-card-header,
  .admin-message-head,
  .admin-audit-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .admin-email-row {
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-user-actions .primary-button,
  .admin-user-actions .ghost-button,
  .admin-user-actions .danger-button {
    width: 100%;
  }
}


.nav-hamburger-button {
  display: none;
}

@media (max-width: 820px) {
  .top-nav {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .menu-logo-link {
    margin: 0;
    justify-self: start;
  }

  .nav-hamburger-button {
    display: inline-grid;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(180, 220, 255, 0.12);
    background:
      linear-gradient(150deg, rgba(255,255,255,0.09), transparent 42%),
      linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
    align-items: center;
    justify-items: center;
    gap: 4px;
    padding: 12px;
  }

  .nav-hamburger-button span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #dff8ff;
  }

  .top-nav-links {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
  }

  .top-nav.is-mobile-open .top-nav-links {
    display: grid;
  }

  .nav-dropdown,
  .nav-login-link,
  .nav-avatar-dropdown,
  .nav-notification-dropdown,
  .nav-logout-link,
  .nav-link {
    width: 100%;
    margin-left: 0;
  }

  .nav-link,
  .nav-dropdown summary,
  .nav-avatar-trigger,
  .nav-bell-trigger {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .nav-dropdown-menu,
  .profile-dropdown-menu,
  .notification-dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    left: auto !important;
    top: auto !important;
    max-height: none !important;
    margin-top: 8px;
  }

  .deck-owner-panel {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
    overflow: hidden;
  }

  .deck-owner-avatar {
    width: 72px;
    height: 72px;
  }

  .deck-owner-actions {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .deck-owner-actions .primary-button,
  .deck-owner-actions .danger-button,
  .deck-owner-actions .like-button {
    width: 100%;
  }

  .workspace-top {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .deck-list-image-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .deck-image-card {
    padding: 8px;
    gap: 8px;
  }

  .deck-image-art {
    min-height: 132px;
  }

  .deck-image-meta strong {
    font-size: 0.84rem;
    line-height: 1.25;
  }

  .deck-image-meta span,
  .deck-image-meta small {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .deck-image-quantity {
    top: 12px;
    right: 12px;
    min-width: 32px;
    padding: 4px 8px;
    font-size: 0.78rem;
  }
}

@media (max-width: 540px) {
  .deck-list-image-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  .deck-image-card {
    padding: 6px;
    border-radius: 14px;
  }

  .deck-image-art {
    min-height: 110px;
    border-radius: 12px;
  }

  .deck-image-meta strong {
    font-size: 0.76rem;
  }

  .deck-image-meta span,
  .deck-image-meta small {
    font-size: 0.66rem;
  }
}

@media (max-width: 760px) {
  .admin-month-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body[data-page="playtest"] {
    --playtest-card-size: 92px;
  }

  body[data-page="playtest"] .playtest-board-panel-clean {
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    min-height: auto;
  }

  body[data-page="playtest"] .playtest-table {
    gap: 10px;
  }

  body[data-page="playtest"] .playtest-battlefield {
    min-height: 42vh;
    padding: 12px 12px 14px;
  }

  body[data-page="playtest"] .playtest-shield-strip,
  body[data-page="playtest"] .playtest-battle-zone-shell,
  body[data-page="playtest"] .playtest-mana-zone-shell {
    padding-right: 0;
  }

  body[data-page="playtest"] .playtest-sidebar {
    position: static;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-page="playtest"] .playtest-turn-panel {
    grid-column: 1 / -1;
    padding: 10px;
  }

  body[data-page="playtest"] .playtest-turn-actions {
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-bottom-rail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-page="playtest"] .playtest-side-zones {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  body[data-page="playtest"] .playtest-hand-shell,
  body[data-page="playtest"] .playtest-side-zones,
  body[data-page="playtest"] .playtest-shield-strip,
  body[data-page="playtest"] .playtest-mana-zone-shell {
    border-radius: 14px;
    padding: 10px;
  }

  body[data-page="playtest"] .playtest-pile-shell {
    padding: 10px;
    min-height: 0;
  }

  body[data-page="playtest"] .playtest-mini-zone,
  body[data-page="playtest"] .playtest-pile-zone {
    min-height: 140px;
  }

  body[data-page="playtest"] .playtest-action-overlay {
    width: min(172px, calc(100vw - 20px));
  }
}

@media (max-width: 540px) {
  body[data-page="playtest"] {
    --playtest-card-size: 78px;
  }

  body[data-page="playtest"] .playtest-board-panel-clean {
    padding-top: 8px;
    padding-left: 8px;
    padding-right: 8px;
  }

  body[data-page="playtest"] .playtest-inline-zone-header span,
  body[data-page="playtest"] .playtest-battlefield-meta {
    font-size: 0.8rem;
  }

  body[data-page="playtest"] .playtest-sidebar {
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-side-button {
    min-height: 42px;
    font-size: 0.95rem;
  }

  body[data-page="playtest"] .playtest-side-zones {
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-inline-card-row {
    gap: 8px;
  }

  body[data-page="playtest"] .playtest-card-grid-battle {
    gap: 8px;
  }

  body[data-page="playtest"] .playtest-pile-zone .playtest-deck-stack {
    width: var(--playtest-card-size);
  }

  body[data-page="playtest"] .playtest-action-overlay {
    width: min(164px, calc(100vw - 16px));
    padding: 8px;
  }

  body[data-page="playtest"] .playtest-action-overlay .small-button {
    min-height: 36px;
    font-size: 0.92rem;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  body[data-page="playtest"] {
    --playtest-card-size: 78px;
  }

  body[data-page="playtest"] .playtest-table {
    display: grid;
    gap: 10px;
  }

  body[data-page="playtest"] .playtest-sidebar {
    order: 2;
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-battlefield-shell {
    order: 1;
  }

  body[data-page="playtest"] .playtest-bottom-rail {
    order: 3;
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-side-zones {
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-battlefield {
    min-height: 40vh;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  body[data-page="playtest"] {
    --playtest-card-size: 72px;
  }

  body[data-page="playtest"] .playtest-table {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 10px;
    align-items: start;
  }

  body[data-page="playtest"] .playtest-battlefield-shell {
    grid-column: 1;
  }

  body[data-page="playtest"] .playtest-sidebar {
    grid-column: 2;
    position: sticky;
    top: 10px;
    width: 100%;
    grid-template-columns: 1fr;
  }

  body[data-page="playtest"] .playtest-bottom-rail {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 10px;
  }

  body[data-page="playtest"] .playtest-side-zones {
    grid-template-columns: 1fr 1fr;
  }

  body[data-page="playtest"] .playtest-battlefield {
    min-height: 52vh;
  }

  body[data-page="playtest"] .playtest-inline-card-row {
    gap: 6px;
  }
}

body[data-page="playtest"] .playtest-mana-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
  margin: 4px 0 10px;
}

body[data-page="playtest"] .playtest-mana-orb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.88), color-mix(in srgb, var(--mana-orb) 86%, #061220) 42%, color-mix(in srgb, var(--mana-orb) 92%, #02060e) 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 14px color-mix(in srgb, var(--mana-orb) 42%, transparent);
}

body[data-page="playtest"] .playtest-card[data-zone="mana"].is-tapped .playtest-card-image,
body[data-page="playtest"] .playtest-card[data-zone="mana"].is-tapped .playtest-card-back {
  transform: rotate(270deg) !important;
  transform-origin: center;
}

body[data-page="playtest"] .playtest-card[data-zone="battle"].is-tapped .playtest-card-image,
body[data-page="playtest"] .playtest-card[data-zone="battle"].is-tapped .playtest-card-back {
  transform: rotate(90deg) !important;
  transform-origin: center;
}

body[data-page="playtest"] .playtest-action-overlay .small-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.playmode-control-grid,
.playmode-board-grid {
  display: grid;
  gap: 18px;
}

.playmode-control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.playmode-board-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 2px solid rgba(131, 235, 255, 0.34);
  background:
    linear-gradient(90deg, rgba(131, 235, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(126, 168, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(111, 235, 255, 0.18), transparent 42%),
    radial-gradient(circle at 18% 24%, rgba(126, 168, 255, 0.16), transparent 34%),
    #06111d;
  background-size: 28px 28px, 28px 28px, auto, auto;
  min-height: 68vh;
}

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

.playmode-match-row {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: default;
}

.playmode-match-row .ghost-button {
  width: max-content;
  min-height: 38px;
  padding: 9px 14px;
}

.playmode-match-code {
  color: var(--muted);
  font-size: 0.92rem;
}

.playmode-board-panel {
  display: grid;
  gap: 18px;
  position: relative;
  padding-top: 76px;
}

.playmode-exit-fixed {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  min-width: 104px;
  box-shadow: 0 18px 36px rgba(139, 38, 38, 0.28);
}

.playmode-spectate-fixed {
  position: absolute;
  top: 14px;
  right: 132px;
  z-index: 20;
  min-width: 136px;
}

.playmode-action-overlay {
  z-index: 2147483645;
}

.playmode-phase-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.playmode-phase-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.playmode-phase-head h3 {
  margin: 4px 0 0;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}

.playmode-phase-track {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playmode-phase-chip {
  appearance: none;
  cursor: pointer;
  opacity: 0.72;
  border-color: rgba(131, 235, 255, 0.18);
}

.playmode-phase-chip:disabled {
  cursor: default;
}

.playmode-phase-chip.is-active {
  opacity: 1;
  color: #05111c;
  border-color: rgba(255, 222, 122, 0.62);
  background: linear-gradient(135deg, #83ebff, #ffde7a);
  box-shadow: 0 0 20px rgba(131, 235, 255, 0.24), 0 0 18px rgba(255, 222, 122, 0.16);
}

.playmode-phase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playmode-choice-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(124, 231, 255, 0.24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(14, 39, 65, 0.9), rgba(5, 18, 33, 0.92));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.playmode-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.playmode-choice-button {
  min-width: 150px;
}

.playmode-seat-panel {
  display: grid;
  gap: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}

.playmode-seat-panel.is-opponent-seat {
  border-bottom: 3px solid rgba(131, 235, 255, 0.24);
}

.playmode-seat-panel.is-self-seat {
  border-top: 3px solid rgba(131, 235, 255, 0.18);
}

.playmode-seat-frame {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr) 190px;
  gap: 8px;
  min-height: 270px;
  padding: 8px;
}

.playmode-seat-frame.is-opponent {
  background:
    radial-gradient(circle at 88% 15%, rgba(131, 235, 255, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(13, 34, 56, 0.82), rgba(7, 19, 33, 0.92)),
    rgba(6, 17, 29, 0.86);
}

.playmode-seat-frame.is-self {
  background:
    radial-gradient(circle at 12% 92%, rgba(126, 168, 255, 0.14), transparent 34%),
    radial-gradient(circle at 78% 20%, rgba(131, 235, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(8, 24, 40, 0.98), rgba(3, 10, 18, 0.98)),
    rgba(4, 10, 18, 0.96);
}

.playmode-player-card {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(131, 235, 255, 0.36);
  background:
    radial-gradient(circle at 50% 0%, rgba(131, 235, 255, 0.16), transparent 42%),
    linear-gradient(180deg, #061522, #0b2135 56%, #04101b);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 18px 36px rgba(2, 8, 22, 0.24);
  color: #f3f8ff;
  min-width: 0;
}

.playmode-avatar-orb {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 12px;
  border: 2px solid rgba(131, 235, 255, 0.78);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 222, 122, 0.5), transparent 26%),
    radial-gradient(circle at 50% 48%, rgba(131, 235, 255, 0.38), transparent 42%),
    linear-gradient(145deg, #10395d, #020914);
  background-size: cover;
  background-position: center;
  font: 700 2.5rem "Cormorant Garamond", serif;
  text-shadow: 0 2px 12px rgba(131, 235, 255, 0.42);
}

.playmode-avatar-orb.has-avatar {
  color: transparent;
  overflow: hidden;
  text-indent: -999px;
}

.playmode-player-card strong,
.playmode-player-card span {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}

.playmode-player-card > span:not(.chip) {
  color: #a6b6cb;
  font-size: 0.78rem;
}

.playmode-player-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.playmode-player-stats span {
  min-width: 30px;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(131, 235, 255, 0.32);
  background: linear-gradient(180deg, #155d9a, #082b4e);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.playmode-table-zones {
  display: grid;
  grid-template-rows: minmax(72px, auto) minmax(128px, 1fr) minmax(76px, auto);
  gap: 8px;
  min-width: 0;
}

.playmode-seat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.playmode-private-counts {
  display: grid;
  gap: 8px;
}

.playmode-count-card {
  border-color: rgba(131, 235, 255, 0.24);
  background:
    radial-gradient(circle at top right, rgba(131, 235, 255, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(10, 36, 61, 0.86), rgba(4, 16, 29, 0.92)),
    rgba(8, 17, 27, 0.78);
}

.playmode-graveyard-toggle {
  width: max-content;
}

.playmode-mini-row.is-collapsed {
  display: none;
}

.playmode-zone-card {
  display: grid;
  gap: 10px;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid rgba(131, 235, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(131, 235, 255, 0.045), rgba(0, 0, 0, 0.12)),
    radial-gradient(circle at 100% 0%, rgba(126, 168, 255, 0.08), transparent 38%),
    rgba(6, 18, 31, 0.78);
  min-width: 0;
}

.playmode-zone-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #eef4ff;
}

.playmode-zone-head span {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.playmode-mini-row {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 86px;
}

.playmode-zone-battle .playmode-mini-row {
  min-height: 126px;
}

.playmode-hand-strip {
  display: grid;
  gap: 8px;
  padding: 8px 8px 10px 172px;
  border-top: 2px solid rgba(131, 235, 255, 0.22);
  background:
    radial-gradient(circle at 22% 0%, rgba(131, 235, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(4, 21, 36, 0.78), rgba(2, 7, 14, 0.74));
}

.playmode-hand-strip .playmode-mini-row {
  min-height: 126px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
}

.playmode-zone-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

body[data-page="playtest"] .page-shell,
body.playmode-match-focus .page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body[data-page="playtest"] .page-stack,
body.playmode-match-focus .page-stack {
  gap: 0;
}

body[data-page="playtest"] .playtest-board-panel-clean {
  min-height: 100vh;
  padding-inline: 0;
}

body.playmode-match-focus .page-stack > .page-hero,
body.playmode-match-focus #playmode-denied,
body.playmode-match-focus #playmode-panel {
  width: 100%;
  max-width: none;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

body.playmode-match-focus .page-hero,
body.playmode-match-focus #playmode-denied,
body.playmode-match-focus #playmode-panel > .panel,
body.playmode-match-focus .playmode-board-panel {
  padding-inline: clamp(18px, 3vw, 32px);
}

body.playmode-match-focus .playmode-board-panel {
  min-height: calc(100vh - 220px);
  border-radius: 0;
  border-left: none;
  border-right: none;
}

body.playmode-match-focus .page-hero,
body.playmode-match-focus .playmode-control-grid,
body.playmode-match-focus .playmode-active-games-panel,
body.playmode-match-focus .playmode-match-list-panel {
  display: none;
}

body.playmode-match-focus #playmode-panel,
body.playmode-match-focus .playmode-board-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.playmode-match-focus .playmode-board-panel {
  height: 100dvh;
  min-height: 100dvh;
  padding: 46px 0 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(111, 235, 255, 0.14), transparent 28%),
    radial-gradient(circle at 85% 2%, rgba(126, 168, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #030914, #06111d 44%, #02060c);
}

body.playmode-match-focus .playmode-board-panel > .panel-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 42px;
  padding: 6px 150px 6px 10px;
  border-bottom: 1px solid rgba(131, 235, 255, 0.28);
  background:
    radial-gradient(circle at left, rgba(131, 235, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #071827, #02070e);
  z-index: 12;
}

body.playmode-match-focus .playmode-board-panel > .panel-header .section-label {
  display: none;
}

body.playmode-match-focus .playmode-board-panel > .panel-header h2 {
  margin: 0;
  font-size: 0.94rem;
}

body.playmode-match-focus .playmode-board-meta,
body.playmode-match-focus #playmode-board-meta {
  font-size: 0.8rem;
}

body.playmode-match-focus .playmode-phase-panel {
  position: fixed;
  right: 0;
  top: 46px;
  bottom: 112px;
  width: 230px;
  z-index: 19;
  align-content: start;
  gap: 10px;
  border-radius: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  padding: 12px 12px;
  background:
    radial-gradient(circle at 0% 12%, rgba(131, 235, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(13, 40, 65, 0.98), rgba(4, 16, 29, 0.98));
  box-shadow: -14px 0 28px rgba(0, 0, 0, 0.24);
}

body.playmode-match-focus .playmode-phase-head {
  display: grid;
  gap: 3px;
}

body.playmode-match-focus .playmode-phase-head .section-label {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}

body.playmode-match-focus .playmode-phase-head .hero-text {
  display: none;
}

body.playmode-match-focus .playmode-phase-head h3 {
  font-size: 0.86rem;
  line-height: 1.1;
}

body.playmode-match-focus .playmode-phase-track,
body.playmode-match-focus .playmode-phase-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

body.playmode-match-focus .playmode-phase-chip,
body.playmode-match-focus .playmode-phase-actions .small-button {
  width: 100%;
  min-height: 34px;
  justify-content: center;
  padding: 8px 7px;
  font-size: 0.72rem;
  text-align: center;
}

body.playmode-match-focus .playmode-phase-actions .small-button {
  line-height: 1.1;
}

body.playmode-match-focus .playmode-event-log {
  display: grid;
  gap: 8px;
  min-height: 0;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(131, 235, 255, 0.22);
}

body.playmode-match-focus .playmode-event-log-head {
  display: grid;
  gap: 3px;
}

body.playmode-match-focus .playmode-event-log-head strong {
  color: #f3f8ff;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.playmode-match-focus .playmode-event-log-head span {
  color: #9fb2d5;
  font-size: 0.68rem;
  line-height: 1.25;
}

body.playmode-match-focus .playmode-event-log-list {
  display: grid;
  gap: 6px;
  max-height: min(34vh, 270px);
  overflow-y: auto;
  padding-right: 3px;
}

body.playmode-match-focus .playmode-event-log-list p {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid rgba(131, 235, 255, 0.16);
  border-radius: 10px;
  background: rgba(2, 10, 18, 0.42);
  color: #dbe8ff;
  font-size: 0.68rem;
  line-height: 1.32;
}

body.playmode-match-focus .playmode-board-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin-right: 230px;
  height: calc(100dvh - 172px);
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(131, 235, 255, 0.16);
  border-bottom: 1px solid rgba(131, 235, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(131, 235, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(131, 235, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 70%, rgba(57, 124, 185, 0.12), transparent 36%),
    linear-gradient(180deg, #121722, #0d121d 49%, #121722 50%, #0a101a);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

body.playmode-match-focus .playmode-seat-panel {
  min-height: 0;
  border: 0;
}

body.playmode-match-focus .playmode-seat-panel.is-opponent-seat {
  border-bottom: 2px solid rgba(225, 237, 255, 0.12);
}

body.playmode-match-focus .playmode-seat-frame {
  grid-template-columns: minmax(0, 1fr) 154px;
  grid-template-areas: "table rail";
  min-height: 100%;
  height: 100%;
  padding: 6px 10px 6px 10px;
  gap: 10px;
  background: transparent;
  overflow: visible;
}

body.playmode-match-focus .playmode-seat-frame.is-opponent {
  align-items: start;
}

body.playmode-match-focus .playmode-seat-frame.is-self {
  align-items: end;
  padding-bottom: 8px;
}

body.playmode-match-focus .playmode-player-card {
  position: absolute;
  left: 14px;
  top: 10px;
  width: 126px;
  min-height: 0;
  padding: 8px;
  border-radius: 14px;
  opacity: 0.92;
  z-index: 2;
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-player-card {
  top: auto;
  bottom: 8px;
}

body.playmode-match-focus .playmode-avatar-orb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2rem;
}

body.playmode-match-focus .playmode-player-card > span:not(.chip),
body.playmode-match-focus .playmode-player-card strong,
body.playmode-match-focus .playmode-player-stats {
  display: none;
}

body.playmode-match-focus .playmode-table-zones {
  grid-area: table;
  display: grid;
  gap: clamp(14px, 2vh, 24px);
  padding-right: 4px;
  min-height: 0;
  overflow: visible;
}

body.playmode-match-focus .playmode-seat-frame.is-opponent .playmode-table-zones {
  grid-template-rows: minmax(70px, 0.68fr) minmax(60px, 0.58fr) minmax(96px, 1.06fr);
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-table-zones {
  grid-template-rows: minmax(96px, 1.06fr) minmax(60px, 0.58fr) minmax(70px, 0.68fr);
}

body.playmode-match-focus .playmode-zone-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body.playmode-match-focus .playmode-zone-head {
  display: none;
}

body.playmode-match-focus .playmode-mini-row {
  gap: 12px;
  min-height: 0;
  align-items: flex-start;
  overflow: visible;
}

body.playmode-match-focus .playmode-zone-battle .playmode-mini-row {
  min-height: 0;
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-mini-row {
  align-items: flex-end;
}

body.playmode-match-focus .playmode-seat-frame.is-opponent .playmode-zone-battle .playmode-mini-row {
  align-items: flex-end;
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-zone-battle .playmode-mini-row {
  align-items: flex-start;
}

body.playmode-match-focus .playmode-shobu-rail {
  grid-area: rail;
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-left: 1px solid rgba(225, 237, 255, 0.12);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(10, 17, 28, 0.58));
}

body.playmode-match-focus .playmode-shobu-rail .playmode-mini-row {
  min-height: 52px;
  justify-content: center;
  align-items: center;
  gap: 0;
}

body.playmode-match-focus .playmode-shobu-rail .playmode-mini-card {
  width: clamp(42px, 4.4vh, 54px);
}

body.playmode-match-focus .playmode-shobu-pile-label,
body.playmode-match-focus .playmode-graveyard-toggle {
  color: #eef4ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.54);
}

body.playmode-match-focus .playmode-graveyard-toggle {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.playmode-match-focus .playmode-hand-strip {
  position: fixed;
  left: 0;
  right: 384px;
  bottom: 0;
  z-index: 11;
  height: 126px;
  min-height: 0;
  padding: 8px 14px 14px;
  border-top: 2px solid rgba(225, 237, 255, 0.12);
  background:
    radial-gradient(circle at 16% 0%, rgba(131, 235, 255, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(17, 23, 35, 0.97), rgba(7, 12, 20, 0.98));
}

body.playmode-match-focus .playmode-hand-strip .playmode-zone-head {
  display: flex;
}

body.playmode-match-focus .playmode-hand-strip .playmode-mini-row {
  min-height: 88px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  align-items: flex-end;
  padding-top: 4px;
}

body.playmode-match-focus .playmode-mini-card {
  width: clamp(44px, min(4.6vw, 9.2vh), 68px);
  border: 2px solid rgba(1, 7, 14, 0.86);
  border-radius: 5px;
  box-shadow:
    0 0 0 1px rgba(131, 235, 255, 0.18),
    0 18px 28px rgba(0, 0, 0, 0.34);
}

body.playmode-match-focus .playmode-mini-card.is-attack-source {
  position: relative;
  z-index: 8;
  border-color: rgba(255, 222, 122, 0.96);
  box-shadow:
    0 0 0 3px rgba(255, 222, 122, 0.28),
    0 0 34px rgba(255, 222, 122, 0.34),
    0 18px 28px rgba(0, 0, 0, 0.34);
}

body.playmode-match-focus .playmode-mini-card.is-attack-source::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 3px;
  height: clamp(34px, 7vh, 72px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 222, 122, 0), rgba(255, 222, 122, 0.96));
  box-shadow: 0 0 18px rgba(255, 222, 122, 0.58);
  pointer-events: none;
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-mini-card.is-attack-source::after {
  top: -78px;
  transform: translateX(-50%);
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-mini-card.is-tapped.is-attack-source::after {
  transform: translateX(-50%) rotate(-90deg);
}

body.playmode-match-focus .playmode-seat-frame.is-opponent .playmode-mini-card.is-attack-source::after {
  bottom: -78px;
  transform: translateX(-50%) rotate(180deg);
}

body.playmode-match-focus .playmode-seat-frame.is-opponent .playmode-mini-card.is-tapped.is-attack-source::after {
  transform: translateX(-50%) rotate(90deg);
}

body.playmode-match-focus .playmode-mini-card.is-attack-source::before {
  content: attr(data-attack-label);
  position: absolute;
  left: 50%;
  min-width: 138px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 222, 122, 0.68);
  border-radius: 999px;
  background: rgba(5, 13, 23, 0.94);
  color: #fff6c9;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34), 0 0 18px rgba(255, 222, 122, 0.2);
  pointer-events: none;
  white-space: normal;
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-mini-card.is-attack-source::before {
  top: -108px;
  transform: translateX(-50%);
}

body.playmode-match-focus .playmode-seat-frame.is-self .playmode-mini-card.is-tapped.is-attack-source::before {
  transform: translateX(-50%) rotate(-90deg);
}

body.playmode-match-focus .playmode-seat-frame.is-opponent .playmode-mini-card.is-attack-source::before {
  bottom: -108px;
  transform: translateX(-50%);
}

body.playmode-match-focus .playmode-seat-frame.is-opponent .playmode-mini-card.is-tapped.is-attack-source::before {
  transform: translateX(-50%) rotate(-90deg);
}

body.playmode-match-focus .playmode-mini-card.is-attack-target {
  position: relative;
  z-index: 7;
  border-color: rgba(131, 235, 255, 0.98);
  box-shadow:
    0 0 0 3px rgba(131, 235, 255, 0.26),
    0 0 34px rgba(131, 235, 255, 0.38),
    0 18px 28px rgba(0, 0, 0, 0.34);
}

.chip.is-active-turn {
  color: #06131f;
  border-color: rgba(255, 222, 122, 0.7);
  background: linear-gradient(135deg, #83ebff, #ffde7a);
  box-shadow: 0 0 22px rgba(131, 235, 255, 0.3), 0 0 18px rgba(255, 222, 122, 0.16);
}

.playmode-mini-card {
  position: relative;
  cursor: pointer;
  pointer-events: auto;
  width: 64px;
  aspect-ratio: 63 / 88;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(131, 235, 255, 0.2);
  background: rgba(131, 235, 255, 0.035);
  box-shadow: 0 12px 24px rgba(2, 8, 20, 0.24);
}

.playmode-mini-card.is-choice-candidate {
  border-color: rgba(255, 222, 122, 0.92);
  box-shadow: 0 0 0 3px rgba(255, 222, 122, 0.22), 0 0 28px rgba(255, 222, 122, 0.32);
  cursor: pointer;
}

.playmode-mini-card.is-tapped {
  transform: rotate(90deg);
  transform-origin: center;
}

.playmode-mini-card.is-mana {
  transform: rotate(180deg);
  transform-origin: center;
}

.playmode-mini-card.is-mana.is-tapped {
  transform: rotate(270deg);
}

.playmode-mana-orbs {
  position: absolute;
  left: 50%;
  bottom: -12px;
  z-index: 12;
  display: flex;
  gap: 4px;
  transform: translateX(-50%) rotate(-180deg);
  pointer-events: none;
}

.playmode-mana-orb,
body[data-page="playmode"] .playtest-mana-orb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.88), color-mix(in srgb, var(--mana-orb) 86%, #061220) 42%, color-mix(in srgb, var(--mana-orb) 92%, #02060e) 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 14px color-mix(in srgb, var(--mana-orb) 42%, transparent);
}

.playmode-mini-card.is-mana.is-tapped .playmode-mana-orbs {
  transform: translateX(-50%) rotate(-270deg);
}

.playmode-card-preview {
  position: fixed;
  z-index: 2147483646;
  width: min(270px, 28vw);
  min-width: 210px;
  padding: 10px;
  border: 1px solid rgba(131, 235, 255, 0.58);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(131, 235, 255, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(8, 24, 40, 0.98), rgba(2, 8, 16, 0.98));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(131, 235, 255, 0.18);
  color: #f3f8ff;
  pointer-events: none;
}

.playmode-card-preview[hidden] {
  display: none;
}

.playmode-card-preview img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
}

.playmode-card-preview strong {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
  text-align: center;
}

.playmode-mini-image,
.playmode-mini-back {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 5px;
}

.playmode-mini-image {
  object-fit: cover;
}

.playmode-mini-back {
  background-size: cover;
  background-position: center;
}

.playmode-zone-empty,
.playmode-zone-statline {
  margin: 0;
  color: var(--muted);
}

.playmode-board-header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

@media (max-width: 980px) {
  .playmode-control-grid,
  .playmode-board-grid,
  .playmode-seat-grid {
    grid-template-columns: 1fr;
  }

  .playmode-seat-frame {
    grid-template-columns: 1fr;
  }

  .playmode-player-card {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    justify-items: start;
    align-items: center;
  }

  .playmode-avatar-orb {
    width: 48px;
    height: 48px;
    font-size: 1.45rem;
  }

  .playmode-player-stats {
    justify-content: flex-start;
  }

  .playmode-hand-strip {
    padding-left: 8px;
  }

  .playmode-zone-sidebar,
  .playmode-private-counts {
    grid-template-columns: 1fr;
  }

  body.playmode-match-focus .playmode-phase-panel {
    width: 150px;
    padding: 10px 7px;
    bottom: 110px;
  }

  body.playmode-match-focus .playmode-phase-head h3 {
    font-size: 0.74rem;
  }

  body.playmode-match-focus .playmode-phase-chip,
  body.playmode-match-focus .playmode-phase-actions .small-button {
    min-height: 30px;
    padding: 7px 5px;
    font-size: 0.62rem;
  }

  body.playmode-match-focus .playmode-board-grid {
    margin-right: 150px;
  }

  body.playmode-match-focus .playmode-hand-strip {
    right: 304px;
    height: 110px;
  }

  body.playmode-match-focus .playmode-event-log-list {
    max-height: 18vh;
  }
}

body[data-page="playtest"] .playtest-side-button-danger {
  border-color: rgba(255, 124, 124, 0.72) !important;
  background: linear-gradient(180deg, rgba(236, 86, 86, 0.98), rgba(143, 26, 26, 0.98)) !important;
  color: #fff5f5 !important;
  box-shadow: 0 0 22px rgba(190, 34, 34, 0.28) !important;
}

body[data-page="playtest"] .playtest-side-button-danger:hover,
body[data-page="playtest"] .playtest-side-button-danger:focus-visible {
  border-color: rgba(255, 167, 167, 0.82) !important;
  background: linear-gradient(180deg, rgba(248, 109, 109, 1), rgba(168, 34, 34, 1)) !important;
}
