/* Pokémon Champions 16:9 Party Sheet — High-Legibility Web Forum & Mobile Optimized Styles */

:root {
  /* ---- Fixed Dark Studio UI Chrome Variables (#0F1115 / #181B20) ---- */
  --ui-bg-canvas: #0F1115;
  --ui-bg-dots: rgba(255, 255, 255, 0.055);
  --ui-bg-glow: rgba(30, 41, 59, 0.32);
  --ui-surface: #181B20;
  --ui-surface-2: #20242C;
  --ui-surface-hover: #282D37;
  --ui-border: rgba(255, 255, 255, 0.09);
  --ui-border-strong: rgba(255, 255, 255, 0.18);
  --ui-text: #F4F4F5;
  --ui-text-sub: #A1A1AA;
  --ui-text-muted: #71717A;
  --ui-accent: #FACC15;
  --ui-accent-fg: #111827;
  --ui-focus: #818CF8;
  --ui-pill-bg: rgba(255, 255, 255, 0.06);
  --ui-pill-text: #D4D4D8;
  --ui-sheet-shadow: 0 20px 52px rgba(0, 0, 0, 0.55);

  /* Theme 1 (Default): Pokémon Champions In-Game (60% Warm Gold-Cream, 30% Periwinkle Slate, 10% Lime/Gold) */
  --canvas-bg: #F7E8AA;
  --canvas-bg-2: #E8D790;
  --canvas-pattern: rgba(255, 255, 255, 0.28);
  --banner-bg: #6466B2;
  --banner-border: rgba(255, 255, 255, 0.92);
  --card-bg: linear-gradient(180deg, #5F61AC 0%, #6F71BA 100%);
  --card-head-bg: rgba(44, 46, 102, 0.72);
  --card-panel-bg: rgba(34, 36, 82, 0.48);
  --card-border: rgba(255, 255, 255, 0.92);
  --card-divider: rgba(255, 255, 255, 0.26);
  --text-main: #FFFFFF;
  --text-sub: #F1F2FF;
  --text-muted: #D8DBF8;
  --accent-primary: #B8EC22;
  --accent-text: #162004;
  --accent-gold: #FACC15;
  --stat-up: #FF94A6;
  --stat-down: #7DD3FC;
  --watermark: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 8px 20px rgba(38, 36, 72, 0.25);
}

body.theme-logo {
  /* Theme 2: Pokémon Champions Logo Stadium Dark */
  --canvas-bg: #0E1424;
  --canvas-bg-2: #090D18;
  --canvas-pattern: rgba(250, 204, 21, 0.04);
  --banner-bg: #1B2746;
  --banner-border: #FACC15;
  --card-bg: linear-gradient(180deg, #17213C 0%, #1E2C4F 100%);
  --card-head-bg: rgba(9, 14, 28, 0.72);
  --card-panel-bg: rgba(8, 12, 24, 0.6);
  --card-border: rgba(250, 204, 21, 0.6);
  --card-divider: rgba(255, 255, 255, 0.16);
  --text-main: #FFFFFF;
  --text-sub: #E2E8F0;
  --text-muted: #CBD5E1;
  --accent-primary: #FACC15;
  --accent-text: #111827;
  --accent-gold: #FACC15;
  --stat-up: #FDA4AF;
  --stat-down: #7DD3FC;
  --watermark: rgba(250, 204, 21, 0.08);
  --card-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

body.theme-dark {
  /* Theme 3: Neutral Dark (#0F1115 base & #181B20 surface) */
  --canvas-bg: #121418;
  --canvas-bg-2: #0F1115;
  --canvas-pattern: rgba(255, 255, 255, 0.025);
  --banner-bg: #181B20;
  --banner-border: rgba(255, 255, 255, 0.22);
  --card-bg: linear-gradient(180deg, #181B20 0%, #1E2229 100%);
  --card-head-bg: rgba(12, 14, 18, 0.72);
  --card-panel-bg: rgba(10, 12, 15, 0.58);
  --card-border: rgba(255, 255, 255, 0.18);
  --card-divider: rgba(255, 255, 255, 0.12);
  --text-main: #F4F4F5;
  --text-sub: #E4E4E7;
  --text-muted: #A1A1AA;
  --accent-primary: #E4E4E7;
  --accent-text: #18181B;
  --accent-gold: #D4D4D8;
  --stat-up: #FDA4AF;
  --stat-down: #7DD3FC;
  --watermark: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--ui-bg-canvas);
  color: var(--ui-text);
  font-family: 'Noto Sans KR', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

input, textarea, select, button {
  font-family: inherit;
  color: inherit;
}

/* ==================== TOP CONTROL BAR (ARCHIVE STUDIO CHROME) ==================== */
.topbar {
  min-height: 44px;
  height: auto;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-left, .topbar-right, .subbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 2px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ui-text);
}

.app-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ui-text);
  white-space: nowrap;
}

.btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, opacity 160ms ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-hover);
}

.btn.active-chip {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: var(--ui-accent-fg);
}

/* ---- UI Language Switcher (언어 / KO · JP · EN) ---- */
.ui-lang-switch {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 2px 3px 2px 8px;
  gap: 3px;
  border-radius: 7px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  flex-shrink: 0;
}

.ui-lang-prefix {
  font-size: 11px;
  font-weight: 700;
  color: var(--ui-text-sub);
  margin-right: 3px;
  white-space: nowrap;
}

.ui-lang-btn {
  height: 24px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ui-text-sub);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.ui-lang-btn:hover {
  color: var(--ui-text);
  background: var(--ui-surface-hover);
}

.ui-lang-btn.active {
  background: var(--ui-accent);
  color: var(--ui-accent-fg);
  font-weight: 800;
}

/* 10% Single Primary Accent Button per 60-30-10 Guide */
.btn-primary-cta {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: var(--ui-accent-fg);
  font-weight: 800;
}

.btn-primary-cta:hover {
  opacity: 0.88;
  background: var(--ui-accent);
}

.ctrl-select, .ctrl-input {
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  outline: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.ctrl-select:hover, .ctrl-input:hover {
  border-color: var(--ui-border-strong);
}

.ctrl-select:focus, .ctrl-input:focus {
  border-color: var(--ui-focus);
  background: var(--ui-surface);
}

.sep {
  width: 1px;
  height: 16px;
  background: var(--ui-border);
  margin: 0 3px;
}

.subbar {
  min-height: 40px;
  height: auto;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 18px;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.subbar-fields {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ui-text-sub);
  white-space: nowrap;
}

/* ==================== 16:9 STUDIO WORKSPACE & SCALER ==================== */
.workspace {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  overflow: hidden;
  background-color: var(--ui-bg-canvas);
  background-image:
    radial-gradient(circle at 50% 45%, var(--ui-bg-glow) 0%, transparent 72%),
    radial-gradient(var(--ui-bg-dots) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px;
}

.stage-viewport {
  flex: 1;
  width: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.stage-scaler {
  width: 1920px;
  height: 1080px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(0.5);
  box-shadow: var(--ui-sheet-shadow);
  border: 1px solid var(--ui-border-strong);
  border-radius: 10px;
  overflow: hidden;
}

body.presentation-mode .topbar,
body.presentation-mode .subbar,
body.presentation-mode .site-footer {
  display: none;
}
body.presentation-mode .workspace {
  padding: 0;
  width: 100vw;
  height: 100vh;
}
body.presentation-mode .stage-scaler {
  box-shadow: none;
  border: none;
  border-radius: 0;
}

.exit-fs-btn {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 900;
  opacity: 0.25;
}
.exit-fs-btn:hover { opacity: 1; }
body.presentation-mode .exit-fs-btn {
  display: inline-flex;
}

/* ==================== 1920x1080 16:9 PARTY SHEET ==================== */
.sheet-16x9 {
  width: 1920px;
  height: 1080px;
  padding: 12px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  background-color: var(--canvas-bg);
  background-image:
    linear-gradient(30deg, var(--canvas-pattern) 12%, transparent 12.5%, transparent 87%, var(--canvas-pattern) 87.5%, var(--canvas-pattern)),
    linear-gradient(150deg, var(--canvas-pattern) 12%, transparent 12.5%, transparent 87%, var(--canvas-pattern) 87.5%, var(--canvas-pattern)),
    linear-gradient(60deg, var(--canvas-pattern) 25%, transparent 25.5%, transparent 75%, var(--canvas-pattern) 75%, var(--canvas-pattern)),
    linear-gradient(115deg, var(--canvas-bg) 0%, var(--canvas-bg) 62%, var(--canvas-bg-2) 62.1%, var(--canvas-bg-2) 100%);
  background-size: 96px 166px, 96px 166px, 96px 166px, 100% 100%;
  overflow: hidden;
}

/* ---- Compact High-Contrast Top Banner ---- */
.sheet-banner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  flex-shrink: 0;
  gap: 14px;
}

.sheet-16x9.hide-banner .sheet-banner {
  display: none;
}

.banner-bar {
  flex: 1;
  height: 60px;
  background: var(--banner-bg);
  border: 2.5px solid var(--banner-border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  overflow: hidden;
}

.banner-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.32;
  padding: 2px 4px;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.banner-center-divider {
  width: 56px;
  height: 60px;
  background: rgba(0, 0, 0, 0.2);
  transform: skewX(-18deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  border-right: 2px solid rgba(255, 255, 255, 0.4);
  margin: 0 18px;
  flex-shrink: 0;
}

.pokeball-emblem {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid #FFFFFF;
  background: linear-gradient(180deg, #EF4444 0%, #EF4444 46%, #FFFFFF 46%, #FFFFFF 54%, #F8FAFC 54%, #F8FAFC 100%);
  transform: skewX(18deg);
  position: relative;
}

.pokeball-emblem::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  background: #FFFFFF;
  border: 2.5px solid #1E293B;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.banner-sub {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.32;
  padding: 2px 4px;
  color: #FFFFFF;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* ==================== PARTY GRID (3x2 or 2x3) ==================== */
.party-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 11px;
  z-index: 2;
  min-height: 0;
}

.party-grid.grid-2x3 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px 14px;
}

/* ==================== POKEMON CARD (LARGE FORUM-READABLE TYPOGRAPHY) ==================== */
.poke-card {
  background: var(--card-bg);
  border: 2.5px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.poke-card:hover {
  border-color: var(--accent-gold);
}

.poke-card.is-mega-active {
  border-color: var(--accent-gold);
}

.card-watermark {
  position: absolute;
  right: 12px;
  bottom: -12px;
  font-family: 'JetBrains Mono', sans-serif;
  font-size: 120px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  color: var(--watermark);
  pointer-events: none;
  z-index: 0;
}

/* ---- Card Top Bar (Huge Name + Gender + Large Type Pills) ---- */
.card-topbar {
  height: 68px;
  background: var(--card-head-bg);
  border-bottom: 1.5px solid var(--card-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px 0 120px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.party-grid.grid-2x3 .card-topbar {
  height: 56px;
  padding-left: 110px;
}

.name-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  margin-right: 6px;
  overflow: hidden;
}

.p-name {
  font-size: 35px;
  font-weight: 900;
  line-height: 1.28;
  padding: 1px 2px 1px 0;
  color: var(--text-main);
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.party-grid.grid-2x3 .p-name {
  font-size: 30px;
}

.p-sub-en {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 2px;
}

.gender-circle {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16.5px;
  font-weight: 900;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.gender-M { background: #2563EB; }
.gender-F { background: #E11D48; }

.head-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.type-chip {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 17px;
  letter-spacing: -0.03em;
  font-weight: 900;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.party-grid.grid-2x3 .type-chip {
  height: 30px;
  font-size: 15.5px;
}

.mega-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 900;
  border: 2px solid #FFFFFF;
  background: rgba(0, 0, 0, 0.45);
  color: #FFFFFF;
  flex-shrink: 0;
  cursor: pointer;
}

.mega-btn.on {
  background: var(--accent-gold);
  border-color: #FFFFFF;
  color: #111827;
}

/* ---- Card Middle Split (Left: Sprite/Ability/Item/Nature, Right: 4 Large Moves) ---- */
.card-split {
  flex: 1;
  display: grid;
  grid-template-columns: 47.5% 52.5%;
  position: relative;
  z-index: 2;
  min-height: 0;
}

.party-grid.grid-2x3 .card-split {
  grid-template-columns: 44% 56%;
}

.card-left-col {
  padding: 8px 9px 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1.5px solid var(--card-divider);
  position: relative;
  min-width: 0;
}

.sprite-anchor {
  position: absolute;
  top: -56px;
  left: 7px;
  width: 116px;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.party-grid.grid-2x3 .sprite-anchor {
  top: -46px;
  width: 100px;
  height: 100px;
}

.poke-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.42));
}

.left-info-stack {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  flex: 1;
  gap: 7px;
  min-width: 0;
}

.party-grid.grid-2x3 .left-info-stack {
  margin-top: 40px;
  gap: 4px;
}

.info-block {
  flex: 1;
  background: var(--card-panel-bg);
  border: 1.5px solid var(--card-divider);
  border-radius: 9px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.party-grid.grid-2x3 .info-block {
  padding: 4px 9px;
}

.ib-tag {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.32);
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.ib-val {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.28;
  padding: 1px 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.38);
  letter-spacing: -0.025em;
  min-width: 0;
  flex: 1;
}

.ib-val-txt {
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 2px;
}

.party-grid.grid-2x3 .ib-val {
  font-size: 21px;
}

.nat-mod-inline {
  font-size: 15.5px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.38);
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.item-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  flex-shrink: 0;
  margin-right: 2px;
}

/* Right Column: 4 Large Forum-Legible Move Rows */
.card-moves-col {
  padding: 6px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  min-width: 0;
}

.move-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 1px;
  border-bottom: 1.5px solid var(--card-divider);
  gap: 6px;
  min-width: 0;
}

.move-row:last-child {
  border-bottom: none;
}

.mv-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.mv-type-sq {
  min-width: 54px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 16px;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.party-grid.grid-2x3 .mv-type-sq {
  height: 28px;
  font-size: 14.5px;
}

.mv-name {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.28;
  padding: 1px 2px 1px 0;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.party-grid.grid-2x3 .mv-name {
  font-size: 23px;
}

.mv-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mv-cat {
  font-size: 16px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text-sub);
  border: 1px solid var(--card-divider);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Card Bottom Section: Massive High-Contrast Lv.50 Real Stats & SP Board ---- */
.card-stats-footer {
  background: var(--card-head-bg);
  border-top: 2px solid var(--card-divider);
  padding: 8px 11px 9px;
  z-index: 2;
}

.party-grid.grid-2x3 .card-stats-footer {
  padding: 6px 12px 7px;
}

.sheet-16x9.hide-stats .card-stats-footer {
  display: none;
}

.stats-6cols {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.stat-box {
  background: var(--card-panel-bg);
  border: 1.5px solid var(--card-divider);
  border-radius: 9px;
  padding: 6px 5px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.party-grid.grid-2x3 .stat-box {
  flex-direction: row;
  padding: 5px 10px;
}

.stat-box.invested {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.42);
}

.st-lbl {
  font-size: 17.5px;
  font-weight: 900;
  color: var(--text-sub);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.st-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 33.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.party-grid.grid-2x3 .st-num {
  font-size: 27px;
}

.st-sp-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 800;
  padding: 1px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.22;
}

.stat-box.invested .st-sp-pill {
  background: var(--accent-primary);
  color: var(--accent-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.up { color: var(--stat-up) !important; }
.down { color: var(--stat-down) !important; }

/* ---- Wide Edit Screen Scaling (Expands Cards & Internal Elements in Browser Viewport) ---- */
.sheet-16x9.is-wide-edit {
  padding: 12px 22px 14px;
}
.sheet-16x9.is-wide-edit .party-grid {
  gap: 12px 16px;
}
.sheet-16x9.is-wide-edit .banner-title {
  font-size: 34px;
}
.sheet-16x9.is-wide-edit .banner-sub {
  font-size: 31px;
}
.sheet-16x9.is-wide-edit .card-topbar {
  height: 70px;
  padding: 0 15px 0 130px;
}
.sheet-16x9.is-wide-edit .p-name {
  font-size: 39px;
}
.sheet-16x9.is-wide-edit .p-sub-en {
  font-size: 19px;
}
.sheet-16x9.is-wide-edit .gender-circle {
  width: 32px;
  height: 32px;
  font-size: 18px;
}
.sheet-16x9.is-wide-edit .type-chip {
  height: 38px;
  padding: 0 14px;
  font-size: 19px;
}
.sheet-16x9.is-wide-edit .mega-btn {
  height: 38px;
  padding: 0 12px;
  font-size: 15.5px;
}
.sheet-16x9.is-wide-edit .sprite-anchor {
  left: 10px;
  top: -60px;
  width: 126px;
  height: 126px;
}
.sheet-16x9.is-wide-edit .card-left-col {
  padding: 8px 12px 8px 14px;
}
.sheet-16x9.is-wide-edit .info-block {
  padding: 5px 12px;
}
.sheet-16x9.is-wide-edit .ib-tag {
  font-size: 16.5px;
  padding: 4px 9px;
}
.sheet-16x9.is-wide-edit .ib-val {
  font-size: 27px;
  gap: 6px;
}
.sheet-16x9.is-wide-edit .nat-mod-inline {
  font-size: 17px;
  padding: 3px 9px;
}
.sheet-16x9.is-wide-edit .item-icon {
  width: 40px;
  height: 40px;
  margin-right: 3px;
}
.sheet-16x9.is-wide-edit .card-moves-col {
  padding: 6px 14px;
}
.sheet-16x9.is-wide-edit .mv-type-sq {
  min-width: 60px;
  height: 35px;
  padding: 0 10px;
  font-size: 17.5px;
}
.sheet-16x9.is-wide-edit .mv-name {
  font-size: 29.5px;
}
.sheet-16x9.is-wide-edit .mv-cat {
  font-size: 17.5px;
  padding: 3px 10px;
}
.sheet-16x9.is-wide-edit .card-stats-footer {
  padding: 8px 14px 9px;
}
.sheet-16x9.is-wide-edit .stats-6cols {
  gap: 9px;
}
.sheet-16x9.is-wide-edit .st-lbl {
  font-size: 19.5px;
}
.sheet-16x9.is-wide-edit .st-num {
  font-size: 37px;
}
.sheet-16x9.is-wide-edit .st-sp-pill {
  font-size: 18.5px;
  padding: 2px 11px;
}

/* ==================== EMPTY / ERROR / MODALS ==================== */
.state-panel {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  background: var(--card-bg);
  border: 2.5px dashed var(--card-border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #FFFFFF;
  text-align: center;
  padding: 40px;
}

.state-title {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.state-desc {
  font-size: 25px;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: -0.02em;
}

.state-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.state-btn {
  height: 58px;
  padding: 0 30px;
  font-size: 22px;
  font-weight: 800;
  border-radius: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.56);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal-card {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ui-text);
}

.modal-head, .modal-foot {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ui-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-foot {
  border-bottom: none;
  border-top: 1px solid var(--ui-border);
}

.modal-subhint {
  font-size: 12px;
  color: var(--ui-text-muted);
}

.modal-sec-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-text-sub);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.paste-area {
  width: 100%;
  height: 320px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border-strong);
  border-radius: 9px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ui-text);
  resize: vertical;
  outline: none;
}

.paste-area:focus {
  border-color: var(--ui-focus);
  background: var(--ui-surface);
}

.editor-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.sp-row {
  display: grid;
  grid-template-columns: 72px 1fr 52px 52px 50px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.sp-row input[type="range"] {
  width: 100%;
  cursor: pointer;
  accent-color: var(--ui-accent);
}

.toast {
  position: fixed;
  bottom: 38px;
  right: 20px;
  background: var(--ui-accent);
  border: 1px solid var(--ui-border-strong);
  color: var(--ui-accent-fg);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 2000;
}
.toast.show { opacity: 1; }

body.presentation-mode .toast {
  bottom: 20px;
}

/* ==================== SCREENSHOT OCR MODAL & STATUS ==================== */
.ocr-pill[hidden],
.ocr-progress-wrap[hidden],
.ocr-thumbs-strip[hidden],
.ocr-summary-box[hidden],
.ocr-preview-wrap[hidden] {
  display: none !important;
}

.ocr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  border: 1px solid var(--ui-border-strong);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease;
}

.ocr-pill:hover {
  background: var(--ui-surface-hover);
}

.ocr-pill.complete {
  border-color: rgba(52, 211, 153, 0.55);
  color: #34d399;
}

.ocr-pill.partial {
  border-color: rgba(251, 191, 36, 0.55);
  color: #fbbf24;
}

.ocr-pill.busy {
  border-color: var(--ui-accent);
  color: var(--ui-text);
}

.ocr-modal-card {
  max-width: 780px;
}

.ocr-drop-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px dashed var(--ui-border-strong);
  background: var(--ui-surface-2);
  transition: border-color 140ms ease, background 140ms ease;
}

.ocr-drop-banner.drag-over {
  border-color: var(--ui-accent);
  background: var(--ui-surface-hover);
}

.ocr-drop-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ui-text-sub);
  line-height: 1.45;
}

.ocr-drop-copy strong {
  font-size: 13px;
  color: var(--ui-text);
}

.ocr-drop-copy code {
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.ocr-drop-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.ocr-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 2px 3px 2px 8px;
  border-radius: 7px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
}

.ocr-lang-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ui-text-sub);
  margin-right: 3px;
  white-space: nowrap;
}

.ocr-lang-btn {
  height: 22px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ui-text-sub);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.ocr-lang-btn:hover {
  color: var(--ui-text);
  background: var(--ui-surface-hover);
}

.ocr-lang-btn.active {
  background: var(--ui-accent);
  color: var(--ui-accent-fg);
  font-weight: 800;
}

.ocr-progress-wrap {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
}

.ocr-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ui-text-sub);
  margin-bottom: 6px;
}

.ocr-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--ui-border);
  overflow: hidden;
}

.ocr-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ui-accent);
  transition: width 180ms ease;
}

.ocr-tabs-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.ocr-tab-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-2);
  font-size: 12px;
}

.ocr-tab-box.saved {
  border-color: rgba(52, 211, 153, 0.45);
}

.ocr-tab-name {
  font-weight: 700;
  color: var(--ui-text);
}

.ocr-tab-state {
  font-size: 11px;
  font-weight: 700;
  color: var(--ui-text-muted);
}

.ocr-tab-box.saved .ocr-tab-state {
  color: #34d399;
}

.ocr-thumbs-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ocr-thumb-card {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ui-surface-2);
  display: flex;
  flex-direction: column;
}

.ocr-thumb-card img {
  width: 100%;
  height: 98px;
  object-fit: cover;
  display: block;
  background: #0f172a;
}

.ocr-thumb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
}

.ocr-tab-switch {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
}

.ocr-tab-switch button {
  border: 0;
  background: transparent;
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  cursor: pointer;
}

.ocr-tab-switch button.active {
  background: var(--ui-accent);
  color: var(--ui-accent-fg);
}

.ocr-summary-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-2);
  font-size: 12px;
  line-height: 1.5;
  max-height: 160px;
  overflow-y: auto;
}

.ocr-summary-row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  color: var(--ui-text-sub);
}

.ocr-summary-row strong {
  color: var(--ui-text);
  min-width: 96px;
  flex-shrink: 0;
}

.ocr-summary-row.ok .ocr-slot-badge {
  color: #34d399;
}

.ocr-summary-row.warn .ocr-slot-badge {
  color: #fbbf24;
}

.ocr-preview-wrap {
  margin-top: 10px;
}

.ocr-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.ocr-preview-area {
  min-height: 145px;
  font-size: 12px;
}

/* ==================== COMPACT DISCLAIMER & CREDITS FOOTER ==================== */
.site-footer {
  min-height: 28px;
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-border);
  padding: 5px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ui-text-muted);
  z-index: 90;
}

.footer-credits {
  white-space: nowrap;
}

.site-footer a {
  color: var(--ui-text-sub);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.25);
  transition: color 140ms ease, border-color 140ms ease;
}

.site-footer a:hover {
  color: var(--ui-text);
  border-bottom-color: var(--ui-text);
}

/* ==================== MOBILE & TABLET RESPONSIVE UI ==================== */
.mobile-subbar-toggle {
  display: none;
}

@media (max-width: 820px) {
  .modal-card {
    max-height: 92dvh;
    border-radius: 12px;
  }

  .modal-head, .modal-foot {
    padding: 12px 14px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .modal-head > span:first-child {
    font-size: 13.5px !important;
    line-height: 1.3;
    min-width: 0;
  }

  .modal-head > div,
  .modal-head > .btn,
  .modal-foot > .btn,
  .modal-foot > div {
    flex-shrink: 0;
  }

  .modal-foot .modal-subhint {
    font-size: 11px;
    line-height: 1.35;
    min-width: 0;
  }

  #pasteModal .modal-foot {
    flex-wrap: wrap;
  }

  .modal-body {
    padding: 14px;
    gap: 12px;
  }

  .editor-2col {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #editorModal .ctrl-input,
  #editorModal select {
    min-width: 0;
    width: 100%;
  }

  .sp-row {
    grid-template-columns: 58px minmax(64px, 1fr) 44px 40px 36px;
    gap: 5px;
    font-size: 12px;
  }

  .sp-row input[type="range"] {
    min-height: 26px;
    touch-action: pan-y;
  }

  .paste-area {
    height: 200px;
  }

  .ocr-preview-area {
    min-height: 135px;
    height: 150px;
  }
}

@media (max-width: 768px) {
  html, body {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.presentation-mode {
    height: 100dvh;
    overflow: hidden;
  }

  .mobile-subbar-toggle {
    display: inline-flex;
    margin-left: auto;
    order: 1;
  }

  .topbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .topbar-left, .topbar-right {
    width: 100%;
    gap: 6px;
  }

  .app-brand {
    margin-right: 0;
    order: 0;
  }

  .app-title {
    font-size: 12.5px;
  }

  .ui-lang-switch {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
    height: 30px;
    padding: 2px 4px 2px 9px;
  }

  .ui-lang-btn {
    flex: 1;
    text-align: center;
  }

  .topbar-left .sep {
    display: block;
    order: 3;
    flex-basis: 100%;
    width: 100%;
    height: 0;
    margin: 0;
    background: transparent;
  }

  .topbar-left .btn:not(.mobile-subbar-toggle),
  .topbar-right .btn {
    order: 4;
    flex: 1 1 calc(50% - 3px);
    justify-content: center;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .ocr-pill {
    order: 10;
    width: 100%;
    justify-content: center;
    height: 28px;
  }

  .subbar {
    display: none;
    padding: 10px 10px;
    gap: 8px;
  }

  body.mobile-subbar-open .subbar {
    display: flex;
  }

  .subbar-fields, .subbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .subbar-fields .field-inline {
    min-width: 0;
  }

  .subbar-fields .field-inline:first-child {
    grid-column: 1 / -1;
  }

  .subbar-fields .ctrl-input {
    width: 100% !important;
    min-width: 0;
    height: 34px;
  }

  .subbar-right .ctrl-select {
    width: 100%;
    min-width: 0;
    height: 34px;
    font-size: 12px;
  }

  .subbar-right .ctrl-select:first-child {
    grid-column: 1 / -1;
  }

  .workspace {
    flex: 1 0 auto;
    min-height: 230px;
    padding: 10px 6px;
    justify-content: center;
  }

  .stage-viewport {
    width: 100%;
    flex: 1 0 auto;
    min-height: 210px;
    aspect-ratio: 16 / 9;
  }

  /* Mobile Edit Flow: 1 card per row vertical list (keeps 16:9 PNG export & fullscreen intact) */
  body.mobile-edit-flow .workspace {
    justify-content: flex-start;
    align-items: stretch;
    padding: 10px 8px 16px;
    min-height: 0;
  }

  body.mobile-edit-flow .stage-viewport {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: none;
    aspect-ratio: auto;
    overflow: visible;
  }

  body.mobile-edit-flow .stage-scaler {
    position: static;
    width: 100%;
    height: auto;
    left: auto;
    top: auto;
    transform: none;
  }

  .sheet-16x9.mobile-card-flow {
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 12px;
    padding: 10px;
    gap: 10px;
  }

  .sheet-16x9.mobile-card-flow .sheet-banner {
    height: auto;
    padding: 0;
  }

  .sheet-16x9.mobile-card-flow .banner-bar {
    height: auto;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    border-width: 1.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
  }

  .sheet-16x9.mobile-card-flow .banner-center-divider {
    height: 44px;
  }

  .sheet-16x9.mobile-card-flow .banner-bar:has(.banner-title:not(:empty), .banner-sub:not(:empty)) {
    padding: 7px 12px;
  }

  .sheet-16x9.mobile-card-flow .banner-bar:has(.banner-title:not(:empty), .banner-sub:not(:empty)) .banner-center-divider {
    display: none;
  }

  .sheet-16x9.mobile-card-flow .banner-title {
    font-size: 14.5px;
    line-height: 1.3;
    white-space: normal;
  }

  .sheet-16x9.mobile-card-flow .banner-sub {
    font-size: 12px;
    line-height: 1.3;
    white-space: normal;
  }

  .sheet-16x9.mobile-card-flow .party-grid,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 10px;
    height: auto;
    flex: none;
  }

  .sheet-16x9.mobile-card-flow .poke-card {
    border-radius: 10px;
    border-width: 1.5px;
    height: auto;
  }

  .sheet-16x9.mobile-card-flow .card-watermark {
    font-size: 56px;
    right: 8px;
    bottom: -6px;
  }

  .sheet-16x9.mobile-card-flow .card-topbar,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .card-topbar {
    height: auto;
    min-height: 44px;
    padding: 6px 8px 6px 70px;
  }

  .sheet-16x9.mobile-card-flow .name-group {
    gap: 4px;
    margin-right: 4px;
  }

  .sheet-16x9.mobile-card-flow .p-name,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .p-name {
    font-size: 16.5px;
    line-height: 1.22;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }

  .sheet-16x9.mobile-card-flow .p-sub-en {
    font-size: 11px;
  }

  .sheet-16x9.mobile-card-flow .gender-circle {
    width: 17px;
    height: 17px;
    font-size: 10px;
    border-width: 1.5px;
  }

  .sheet-16x9.mobile-card-flow .head-right-group {
    gap: 4px;
  }

  .sheet-16x9.mobile-card-flow .mega-btn {
    height: 22px;
    padding: 0 6px;
    font-size: 10.5px;
    border-radius: 5px;
    border-width: 1px;
  }

  .sheet-16x9.mobile-card-flow .type-chip {
    height: 22px;
    padding: 0 7px;
    font-size: 11px;
    border-radius: 5px;
    border-width: 1px;
  }

  .sheet-16x9.mobile-card-flow .card-split {
    grid-template-columns: 48.5% 51.5%;
    flex: none;
    height: auto;
  }

  .sheet-16x9.mobile-card-flow .sprite-anchor {
    left: 6px;
    top: -42px;
    width: 62px;
    height: 62px;
  }

  .sheet-16x9.mobile-card-flow .card-left-col {
    padding: 20px 5px 7px 5px;
  }

  .sheet-16x9.mobile-card-flow .left-info-stack {
    gap: 5px;
  }

  .sheet-16x9.mobile-card-flow .info-block {
    padding: 4px 4px;
    border-radius: 6px;
    border-width: 1px;
    gap: 2.5px;
  }

  .sheet-16x9.mobile-card-flow .ib-tag {
    font-size: 8.5px;
    padding: 1.5px 3px;
    border-radius: 4px;
  }

  .sheet-16x9.mobile-card-flow .ib-val,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .ib-val {
    font-size: 10px;
    gap: 2px;
  }

  .sheet-16x9.mobile-card-flow .ib-val-txt {
    flex-shrink: 1;
    min-width: 0;
    padding-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sheet-16x9.mobile-card-flow .item-icon {
    width: 15px;
    height: 15px;
    margin-right: 1px;
  }

  .sheet-16x9.mobile-card-flow .nat-mod-inline {
    font-size: 8px;
    padding: 1px 2.5px;
    border-radius: 4px;
  }

  .sheet-16x9.mobile-card-flow .card-moves-col {
    padding: 3px 5px;
  }

  .sheet-16x9.mobile-card-flow .move-row {
    padding: 3.5px 0;
    gap: 3px;
    border-bottom-width: 1px;
  }

  .sheet-16x9.mobile-card-flow .mv-left {
    gap: 3px;
  }

  .sheet-16x9.mobile-card-flow .mv-type-sq,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .mv-type-sq {
    min-width: 28px;
    height: 19px;
    padding: 0 3.5px;
    border-radius: 4px;
    font-size: 9px;
    border-width: 1px;
  }

  .sheet-16x9.mobile-card-flow .mv-name,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .mv-name {
    font-size: 11px;
    line-height: 1.22;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  .sheet-16x9.mobile-card-flow .mv-cat {
    font-size: 9px;
    padding: 1.5px 3.5px;
    border-radius: 4px;
  }

  .sheet-16x9.mobile-card-flow .card-stats-footer,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .card-stats-footer {
    padding: 6px 8px 7px;
    border-top-width: 1.5px;
  }

  .sheet-16x9.mobile-card-flow .stats-6cols {
    gap: 4px;
  }

  .sheet-16x9.mobile-card-flow .stat-box,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .stat-box {
    flex-direction: column;
    padding: 4px 2px;
    gap: 1px;
    border-radius: 6px;
    border-width: 1px;
  }

  .sheet-16x9.mobile-card-flow .st-lbl {
    font-size: 10.5px;
  }

  .sheet-16x9.mobile-card-flow .st-num,
  .sheet-16x9.mobile-card-flow .party-grid.grid-2x3 .st-num {
    font-size: 15.5px;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }

  .sheet-16x9.mobile-card-flow .st-sp-pill {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
  }

  .sheet-16x9.mobile-card-flow .state-panel {
    padding: 28px 16px;
    min-height: 220px;
    border-radius: 10px;
    gap: 10px;
  }

  .sheet-16x9.mobile-card-flow .state-title {
    font-size: 18px;
    line-height: 1.35;
  }

  .sheet-16x9.mobile-card-flow .state-desc {
    font-size: 12.5px;
    line-height: 1.5;
    max-width: 100%;
  }

  .sheet-16x9.mobile-card-flow .state-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 6px;
  }

  .sheet-16x9.mobile-card-flow .state-btn {
    width: 100%;
    height: 38px;
    font-size: 13px;
    padding: 0 14px;
  }

  .exit-fs-btn {
    opacity: 0.85;
    top: 10px;
    right: 10px;
  }

  .state-panel {
    padding: 48px 36px;
    gap: 24px;
  }

  .state-title {
    font-size: 84px;
  }

  .state-desc {
    font-size: 46px;
    line-height: 1.45;
  }

  .state-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
  }

  .state-btn {
    height: 124px;
    padding: 0 44px;
    font-size: 46px;
    border-radius: 24px;
  }

  .ocr-drop-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .ocr-drop-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .ocr-lang-switch {
    flex: 1 1 auto;
    justify-content: space-between;
  }

  .ocr-lang-btn {
    flex: 1;
    text-align: center;
  }

  .ocr-drop-banner label.btn {
    flex: 1 1 140px;
    justify-content: center;
    height: 36px;
  }

  .ocr-tabs-status {
    grid-template-columns: 1fr;
  }

  .ocr-tab-box {
    padding: 10px 12px;
  }

  .ocr-thumbs-strip {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 8px 12px;
    font-size: 10.5px;
    gap: 4px;
  }

  .footer-credits {
    white-space: normal;
    line-height: 1.5;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    text-align: center;
  }
}
