/* ═══════════════════ OPTION D — CAMPAIGN MAP (MOBILE-FIRST) ═══════════════════ */

.app-campaign .hidden {
    display: none !important;
}

.app-campaign .btn {
    color: var(--black);
}

.app-campaign .btn-primary {
    color: var(--white);
}

.app-campaign {
    --font-display: 'Baloo 2', 'Noto Sans', cursive;
    --font-ui: 'DM Sans', 'Noto Sans', system-ui, sans-serif;
    --header-h: 56px;
    --bottom-nav-h: 64px;
    --coach-h: 88px;
    --scroll-card: #fffbf2;
    /* Festival palette — pulled from the hand-drawn result cards */
    --fest-red: #e8332f;
    --fest-deep-red: #a4133c;
    --fest-orange: #ff7a1a;
    --fest-pink: #f543ae;
    --fest-magenta: #d6219c;
    --fest-turquoise: #3ec6c9;
    --fest-gold: #ffc426;
    --fest-paper: #f7efe2;
    --fest-purple: #7b4fd1;
    --banner-bg: linear-gradient(180deg, #c9184a 0%, #8e0e38 100%);
    padding: 0 !important;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden;
    background-color: #1a0a2e;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(255, 196, 38, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, #1a0a2e 0%, #2d1b4e 40%, #1a0a2e 100%);
}

.app-campaign .border-scroll-left,
.app-campaign .border-scroll-right,
.app-campaign .border-ornament {
    display: none;
}

.app-campaign h1,
.app-campaign h2,
.app-campaign h3,
.app-campaign h4 {
    font-family: var(--font-display);
}

.app-campaign,
.app-campaign .btn,
.app-campaign input,
.app-campaign table {
    font-family: var(--font-ui);
}

/* ─── HEADER ─── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    height: var(--header-h);
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--banner-bg);
    border-bottom: 3px solid var(--black);
    box-shadow: 0 4px 0 var(--black);
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--white);
    min-width: 0;
}

.app-header__logo {
    width: 36px;
    height: 36px;
    filter: drop-shadow(2px 2px 0 var(--black));
    flex-shrink: 0;
}

.app-header__logo--char {
    width: 32px;
    height: 40px;
    object-fit: contain;
    object-position: bottom;
    background: none;
}

.app-header__titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header__title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--golden-yellow);
    text-shadow: 1px 1px 0 var(--black);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header__subtitle {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.app-header__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--golden-yellow);
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 2px 8px;
    box-shadow: 2px 2px 0 var(--black);
    line-height: 1.1;
}

.app-header__score-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--black);
}

.app-header__score-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--hot-pink);
    font-variant-numeric: tabular-nums;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 4px 8px;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-ui);
}

.lang-toggle__active {
    color: var(--golden-yellow);
}

.lang-toggle__sep {
    opacity: 0.4;
}

.lang-toggle__inactive {
    opacity: 0.55;
}

.ai-live-badge {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--golden-yellow);
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid var(--golden-yellow);
    border-radius: 6px;
    padding: 3px 6px;
    white-space: nowrap;
}

.battle-arena__ai-live {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--fest-magenta);
    vertical-align: middle;
}

.tarot-card--fetching .tarot-card__inner {
    animation: tarotShuffle 0.5s ease infinite;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--black);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--black);
    color: var(--black);
}

/* ─── MAIN & PANELS ─── */
.app-main {
    margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    min-height: calc(100dvh - var(--header-h) - var(--bottom-nav-h));
}

.app-panel {
    display: none;
    padding: 12px 12px 16px;
    animation: panelIn 0.25s ease;
}

.app-panel--active {
    display: block;
}

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

.panel-head {
    text-align: center;
    margin-bottom: 16px;
}

.panel-head__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--golden-yellow);
    text-shadow: 2px 2px 0 var(--black);
    line-height: 1.2;
}

.panel-head__sub {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 2px;
}

html[lang="en"] .panel-head__title { font-size: 1.35rem; }

/* ─── MAP HERO ─── */
.map-hero {
    background: linear-gradient(160deg, #ff2e63 0%, var(--fest-deep-red) 52%, var(--fest-purple) 115%);
    border: 3px solid var(--black);
    border-radius: 18px;
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    box-shadow: 5px 5px 0 var(--black), inset 0 0 0 2px rgba(255, 196, 38, 0.55);
    position: relative;
    overflow: hidden;
}

.map-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('assets/clouds.png') center/cover;
    opacity: 0.14;
    pointer-events: none;
}

/* Festival sunburst rays */
.map-hero::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 220%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        rgba(255, 213, 79, 0.16) 0deg 8deg,
        transparent 8deg 19deg
    );
    animation: sunburstSpin 36s linear infinite;
    pointer-events: none;
}

@keyframes sunburstSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.map-hero__trophy {
    position: absolute;
    right: -6px;
    top: -8px;
    width: 72px;
    height: 72px;
    opacity: 0.22;
    filter: drop-shadow(2px 2px 0 var(--black));
    pointer-events: none;
    transform: rotate(12deg);
}

.map-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.map-hero__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--golden-yellow);
    text-shadow: 2px 2px 0 var(--black);
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.map-hero__title-en {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: none;
    font-family: var(--font-ui);
}

html[lang="en"] .map-hero__title > span:first-child { font-size: 0.72rem; opacity: 0.85; font-family: var(--font-ui); font-weight: 600; }
html[lang="en"] .map-hero__title-en { font-size: 1.3rem; font-family: var(--font-display); font-weight: 800; color: var(--golden-yellow); text-shadow: 2px 2px 0 var(--black); }

.map-hero__streak {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid var(--black);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.85rem;
}

.map-hero__streak strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--golden-yellow);
}

.map-hero__clash {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.map-clash-score {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--scroll-card);
    border: 2px solid var(--black);
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 3px 3px 0 var(--black);
}

.map-clash-score--human .map-clash-num { color: #1d4ed8; }
.map-clash-score--ai .map-clash-num { color: var(--hot-pink); }

.map-clash-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-card-muted);
    letter-spacing: 0.3px;
}

.map-clash-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.map-clash-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 52px;
}

.map-clash-vs {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--golden-yellow);
    text-shadow: 1px 1px 0 var(--black);
}

.map-clash-record {
    display: flex;
    gap: 3px;
}

.record-pill {
    font-size: 0.5rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 6px;
    border: 1.5px solid var(--black);
    background: rgba(255, 255, 255, 0.9);
    color: var(--black);
    font-variant-numeric: tabular-nums;
}

.record-pill--win { background: #bbf7d0; }
.record-pill--tie { background: #fef08a; }
.record-pill--loss { background: #fecdd3; }

.campaign-progress {
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.campaign-progress__labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 4px;
}

.campaign-progress__labels strong {
    font-family: var(--font-display);
    color: var(--golden-yellow);
}

.campaign-progress__track {
    height: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid var(--black);
    border-radius: 10px;
    overflow: hidden;
}

.campaign-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--golden-yellow), #ff9500);
    border-radius: 8px;
    transition: width 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ─── PHASE TABS ─── */
.map-phase-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.map-phase-tab {
    flex: 1;
    padding: 10px 12px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--black);
    border-radius: 12px;
    color: var(--white);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.map-phase-tab--active {
    background: var(--golden-yellow);
    color: var(--black);
    box-shadow: 3px 3px 0 var(--black);
}

.map-phase-tab:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--black);
}

/* ─── GROUP SELECTOR ─── */
.group-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.group-selector::-webkit-scrollbar { display: none; }
.group-selector--hidden { display: none; }

.group-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 48px;
    padding: 8px 10px 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid var(--black);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.group-chip--active {
    background: var(--chip-color, var(--golden-yellow));
    box-shadow: 3px 3px 0 var(--black);
    transform: translateY(-2px);
}

.group-chip__letter {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.group-chip--active .group-chip__letter { color: var(--black); }

.group-chip__count {
    font-size: 0.5rem;
    font-weight: 700;
    opacity: 0.8;
    color: var(--white);
}

.group-chip--active .group-chip__count { color: var(--black); }

.group-chip__done {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #4ade80;
    border: 2px solid var(--black);
    border-radius: 50%;
    font-size: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black);
    font-weight: 900;
}

/* ─── MAP LEGEND ─── */
.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
}

.map-legend__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.58rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--black);
    flex-shrink: 0;
}

.legend-dot--pending { background: var(--scroll-card); }
.legend-dot--predicted { background: #93c5fd; }
.legend-dot--win { background: #4ade80; }
.legend-dot--loss { background: #fb7185; }

/* ─── CAMPAIGN MAP CANVAS ─── */
#panel-map {
    padding-bottom: 8px;
    position: relative;
    z-index: 2;
}

.campaign-map-scroll {
    position: relative;
    max-height: none;
    overflow: visible;
    padding-bottom: 8px;
}

.campaign-path-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.campaign-map-canvas {
    position: relative;
    z-index: 2;
}

/* Group island */
.group-island {
    position: relative;
}

.group-island__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: var(--island-color, var(--golden-yellow));
    border: 3px solid var(--black);
    border-radius: 16px;
    box-shadow: 5px 5px 0 var(--black);
}

.group-island__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-island__badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid var(--black);
    border-radius: 12px;
    color: var(--black);
    box-shadow: 2px 2px 0 var(--black);
}

.group-island__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--black);
    display: block;
    line-height: 1.1;
}

.group-island__sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.65);
}

.group-island__ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#4ade80 calc(var(--ring-pct) * 1%), rgba(255,255,255,0.5) 0);
    box-shadow: 2px 2px 0 var(--black);
}

.group-island__ring span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--scroll-card);
    border: 2px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--black);
}

.group-path {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 2px;
}

.group-path__slot {
    position: relative;
    z-index: 2;
}

/* Match scroll cards (poster style) */
.match-scroll-card {
    width: 100%;
    text-align: left;
    background: var(--scroll-card);
    border: 3px solid var(--black);
    border-radius: 16px;
    padding: 0 0 10px;
    box-shadow: 4px 4px 0 var(--black);
    cursor: pointer;
    font-family: var(--font-ui);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
    position: relative;
}

.match-scroll-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 6px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
    border-radius: 0 0 8px 8px;
    pointer-events: none;
}

.match-scroll-card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--black);
}

.match-scroll-card--predicted { border-color: #2563eb; box-shadow: 4px 4px 0 #1e40af; }
.match-scroll-card--human-win { border-color: #166534; background: linear-gradient(180deg, #ecfdf5, var(--scroll-card)); box-shadow: 4px 4px 0 #166534; }
.match-scroll-card--ai-win { border-color: #9f1239; background: linear-gradient(180deg, #fff1f2, var(--scroll-card)); box-shadow: 4px 4px 0 #9f1239; }
.match-scroll-card--tie { border-color: #b8860b; box-shadow: 4px 4px 0 #b8860b; }
.match-scroll-card--locked { opacity: 0.7; cursor: not-allowed; background: #e2e8f0; }
.match-scroll-card--locked:active { transform: none; box-shadow: 4px 4px 0 var(--black); }

.match-scroll-card__ribbon {
    display: block;
    padding: 6px 12px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--golden-yellow);
    border-bottom: 2px solid var(--black);
    color: var(--black);
}

.match-scroll-card--human-win .match-scroll-card__ribbon { background: #4ade80; }
.match-scroll-card--ai-win .match-scroll-card__ribbon { background: #fb7185; color: var(--white); }
.match-scroll-card--predicted .match-scroll-card__ribbon { background: #93c5fd; }

.match-scroll-card__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
    padding: 10px 12px 6px;
}

.match-scroll-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.match-scroll-card__team--away { align-items: center; }

.match-scroll-card__flag {
    width: 36px;
    height: 24px;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--black);
    border-radius: 4px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.match-scroll-card__name {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--black);
    text-align: center;
    line-height: 1.2;
    width: 100%;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
}

.match-scroll-card__mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
}

.match-scroll-card__vs {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--hot-pink);
}

.match-scroll-card__actual {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--black);
    font-variant-numeric: tabular-nums;
}

.match-scroll-card__duel {
    display: flex;
    margin: 0 12px 8px;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.match-scroll-card__pick {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    gap: 2px;
}

.match-scroll-card__pick--human { background: rgba(59, 130, 246, 0.1); border-right: 1px dashed rgba(0,0,0,0.1); }
.match-scroll-card__pick--ai { background: rgba(255, 0, 96, 0.08); }

.pick-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-card-muted);
    text-transform: uppercase;
}

.match-scroll-card__pick strong {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--black);
}

.match-scroll-card__cta {
    display: block;
    text-align: center;
    margin: 0 12px;
    padding: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-card-muted);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
}

.match-scroll-card__badge {
    display: block;
    text-align: center;
    margin: 0 12px;
    padding: 5px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 8px;
    border: 2px solid var(--black);
}

.match-scroll-card__badge--pred { background: #dbeafe; color: #1e40af; }
.match-scroll-card__badge--win { background: #4ade80; color: #14532d; }
.match-scroll-card__badge--loss { background: #fb7185; color: #881337; }
.match-scroll-card__badge--tie { background: var(--golden-yellow); color: var(--black); }

.match-scroll-card__locked-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-card-muted);
}

.match-scroll-card__locked-body span:first-child { font-size: 1.5rem; }

/* Knockout */
.ko-campaign { display: flex; flex-direction: column; gap: 20px; }

.ko-round-section__title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
    color: var(--golden-yellow);
    text-shadow: 1px 1px 0 var(--black);
    margin-bottom: 12px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--black);
    border-radius: 20px;
}

.ko-round-section__cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Mascot coach bar */
.mascot-coach {
    position: sticky;
    bottom: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 0 4px;
    margin-top: 12px;
    pointer-events: none;
    background: linear-gradient(0deg, #1a0a2e 40%, transparent);
}

.mascot-coach__avatars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.mascot-coach__avatars {
    flex-direction: row !important;
    align-items: flex-end;
    gap: 2px;
}

.mascot-coach__mini {
    width: 30px;
    height: 42px;
    object-fit: contain;
    object-position: bottom;
    opacity: 0.55;
    filter: drop-shadow(1.5px 1.5px 0 rgba(0, 0, 0, 0.55));
    transition: opacity 0.2s, transform 0.2s;
    transform-origin: bottom center;
    animation: mascotIdle 2.6s ease-in-out infinite;
}

.mascot-coach__mini:nth-child(2) { animation-delay: 0.4s; }
.mascot-coach__mini:nth-child(3) { animation-delay: 0.9s; }

@keyframes mascotIdle {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.94) scaleX(1.03); }
}

.mascot-coach__mini--active {
    opacity: 1;
    animation: coachTaunt 0.9s ease infinite;
}

@keyframes coachTaunt {
    0%, 100% { transform: scale(1.22) rotate(-4deg); }
    50% { transform: scale(1.28) rotate(5deg) translateY(-3px); }
}

.mascot-coach__bubble {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--scroll-card);
    border: 3px solid var(--black);
    border-radius: 16px 16px 16px 4px;
    padding: 8px 12px;
    box-shadow: 4px 4px 0 var(--black);
    min-height: 52px;
}

.mascot-coach__face {
    width: 40px;
    height: 48px;
    object-fit: contain;
    object-position: bottom;
    flex-shrink: 0;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
}

.mascot-coach .mascot-coach__bubble {
    border-color: var(--fest-magenta);
    box-shadow: 4px 4px 0 var(--fest-deep-red);
}

.mascot-coach__text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--black);
    line-height: 1.3;
    margin: 0;
}

/* ─── BOTTOM NAV ─── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    background: var(--banner-bg);
    border-top: 3px solid var(--black);
    box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.bottom-nav__btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 6px 4px;
    font-family: var(--font-ui);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav__btn--active {
    color: var(--golden-yellow);
    background: rgba(255, 208, 0, 0.12);
}

.bottom-nav__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.bottom-nav__label {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1;
}

.bottom-nav__label-en {
    font-size: 0.5rem;
    font-weight: 500;
    opacity: 0.7;
}

html[lang="en"] .bottom-nav__label { font-size: 0.55rem; opacity: 0.75; }
html[lang="en"] .bottom-nav__label-en { font-size: 0.65rem; font-weight: 700; opacity: 1; color: var(--golden-yellow); }

/* ─── BATTLE SHEET ─── */
.battle-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.battle-sheet-backdrop--open {
    opacity: 1;
    visibility: visible;
}

.battle-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(12, 6, 28, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 8px) 12px calc(var(--bottom-nav-h) + 8px);
}

.battle-sheet--pavilion.battle-sheet--open {
    opacity: 1;
    visibility: visible;
}

.pavilion__rays {
    position: absolute;
    left: 50%;
    top: 45%;
    width: 200vmax;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        rgba(255, 196, 38, 0.1) 0deg 8deg,
        transparent 8deg 18deg
    );
    animation: sunburstSpinCenter 30s linear infinite;
    pointer-events: none;
}

.pavilion__frame {
    position: relative;
    width: min(100%, 420px);
    max-height: 100%;
    background: var(--fest-paper);
    border: 4px solid var(--black);
    border-radius: 20px;
    box-shadow:
        0 0 0 3px var(--fest-gold),
        8px 8px 0 var(--black),
        0 0 40px rgba(255, 196, 38, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pavilionIn 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes pavilionIn {
    from { opacity: 0; transform: scale(0.88) translateY(24px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.pavilion__title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--fest-deep-red);
    padding: 12px 40px 4px;
    background: linear-gradient(180deg, rgba(255, 196, 38, 0.2), transparent);
}

.pavilion__close {
    top: 8px;
    right: 10px;
}

.battle-sheet__handle {
    width: 40px;
    height: 4px;
    background: var(--black);
    border-radius: 2px;
    margin: 10px auto 0;
    opacity: 0.25;
    flex-shrink: 0;
}

.battle-sheet__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 2px solid var(--black);
    border-radius: 50%;
    background: var(--white);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    box-shadow: 2px 2px 0 var(--black);
    color: var(--black);
}

.battle-sheet__inner {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 14px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.battle-arena--ritual { background: transparent; }
.battle-arena__header--ritual { margin-bottom: 6px; padding-right: 0; }
.battle-arena__teams--compact { margin-bottom: 10px; }
.battle-arena__teams--compact .battle-arena__art--placeholder { width: 48px; height: 34px; }
.battle-arena__ai--ritual { order: -1; }
.battle-arena__human--ritual {
    background: linear-gradient(180deg, rgba(255, 196, 38, 0.15), rgba(255, 196, 38, 0.05));
    border: 2.5px solid var(--black);
    border-radius: 14px;
    padding: 10px;
    margin-top: 10px;
}
.tarot-table--ritual {
    border-radius: 14px;
    border: 2.5px solid var(--black);
}

.battle-arena__header {
    text-align: center;
    margin-bottom: 12px;
    padding-right: 40px;
}

.battle-arena__match-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-card-muted);
    text-transform: uppercase;
}

.battle-arena__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--black);
}

.battle-arena__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: end;
    margin-bottom: 16px;
}

.battle-arena__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.battle-arena__team--away {
    flex-direction: column;
}

.battle-arena__art {
    width: 72px;
    height: 88px;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(2px 2px 0 var(--black));
}

.battle-arena__art--placeholder {
    width: 56px;
    height: 56px;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--black);
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--black);
}

.battle-arena__name {
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    color: var(--black);
    line-height: 1.2;
    width: 100%;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
}

.battle-arena__vs {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--hot-pink);
    padding-bottom: 24px;
}

.battle-arena__human {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 3px solid var(--black);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 4px 4px 0 var(--black);
}

.battle-arena__human-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    color: var(--black);
}

.battle-arena__scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.battle-arena__score-input {
    width: 56px;
    height: 56px;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    border: 3px solid var(--black);
    border-radius: 12px;
    background: var(--white);
    color: var(--black);
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.battle-arena__score-input::-webkit-outer-spin-button,
.battle-arena__score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.battle-arena__score-sep {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
}

.battle-arena__ai {
    border: 3px solid var(--black);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 4px 4px 0 var(--black);
}

.battle-arena__ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--banner-bg);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
}

.battle-arena__ai-list {
    background: var(--white);
}

.battle-arena__ai-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

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

.battle-arena__ai-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--black);
}

.battle-arena__ai-name img {
    width: 24px;
    height: 24px;
}

.battle-arena__ai-score {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    background: var(--golden-yellow);
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 2px 10px;
    font-variant-numeric: tabular-nums;
}

.battle-arena__stamp {
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 12px;
    border: 3px solid var(--black);
}

.battle-arena__stamp--human {
    background: #4ade80;
    box-shadow: 3px 3px 0 #166534;
}

.battle-arena__stamp--ai {
    background: #fb7185;
    box-shadow: 3px 3px 0 #9f1239;
}

.battle-arena__stamp--draw {
    background: var(--golden-yellow);
    box-shadow: 3px 3px 0 #b8860b;
}

.battle-arena__actual {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
}

.battle-arena__actual-score {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
}

.battle-arena__admin {
    border-top: 2px dashed var(--black);
    padding-top: 12px;
    margin-top: 8px;
}

.battle-arena__admin-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
    color: var(--text-card-muted);
}

.battle-arena__save-btn {
    width: 100%;
    margin-top: 12px;
}

/* ─── CLASH / RANK MOBILE OVERRIDES ─── */
.clash-dashboard--mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clash-dashboard--mobile .clash-card {
    background: var(--cream);
    border: 3px solid var(--black);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 4px 4px 0 var(--black);
    color: var(--text-card);
}

.clash-dashboard--mobile h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--black);
}

.achievements-section--mobile {
    margin-bottom: 16px;
}

.achievements-section--mobile .badges-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.achievements-section--mobile .badge-card {
    flex: 0 0 100px;
    min-height: 100px;
}

.leaderboard-table-wrapper--mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 3px solid var(--black);
    border-radius: 16px;
    box-shadow: 4px 4px 0 var(--black);
    background: var(--cream);
}

.leaderboard-table-wrapper--mobile .leaderboard-table {
    color: var(--text-card);
    font-size: 0.8rem;
}

.rules-grid--mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rules-grid--mobile .rule-card {
    background: var(--cream);
    color: var(--text-card);
    border: 3px solid var(--black);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 4px 4px 0 var(--black);
}

.rules-admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.rules-admin-bar .admin-toggle-btn {
    font-size: 0.8rem;
    color: var(--white);
}

body[data-active-panel="clash"] .mascot-coach,
body[data-active-panel="rank"] .mascot-coach,
body[data-active-panel="rules"] .mascot-coach {
    display: none;
}

/* ─── TABLET+ ─── */
@media (min-width: 768px) {
    .app-campaign {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
    }

    .app-header,
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

}

/* ═══════════════════ FESTIVAL POSTER BUTTON ═══════════════════ */
.festival-poster-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: linear-gradient(105deg, var(--fest-red) 0%, var(--fest-orange) 50%, var(--fest-pink) 100%);
    border: 3px solid var(--black);
    border-radius: 14px;
    box-shadow: 4px 4px 0 var(--black), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-family: var(--font-ui);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.festival-poster-btn::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px dashed rgba(255, 244, 200, 0.7);
    border-radius: 9px;
    pointer-events: none;
}

.festival-poster-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--black);
}

.festival-poster-btn__icon {
    font-size: 1.3rem;
    animation: lanternSway 2.4s ease-in-out infinite;
    transform-origin: top center;
}

.festival-poster-btn__icon:last-child { animation-delay: 1.2s; }

@keyframes lanternSway {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

.festival-poster-btn__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.festival-poster-btn__text strong {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 1.5px 1.5px 0 var(--black);
}

.festival-poster-btn__text small {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════ TAROT CARD DRAW ═══════════════════ */
.tarot-table {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 196, 38, 0.18), transparent 65%),
        linear-gradient(180deg, #2d1b4e 0%, #1d1136 100%);
    padding: 14px 12px 12px;
}

.tarot-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tarot-card {
    flex: 1;
    max-width: 110px;
    aspect-ratio: 5 / 7;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    perspective: 700px;
    -webkit-tap-highlight-color: transparent;
}

.tarot-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 1.4, 0.5, 1);
}

.tarot-card--flipped .tarot-card__inner {
    transform: rotateY(180deg);
}

.tarot-card__back,
.tarot-card__face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 2.5px solid var(--black);
    border-radius: 10px;
    overflow: hidden;
}

.tarot-card__back {
    background:
        url('assets/border.png') center/cover,
        linear-gradient(160deg, var(--fest-red) 0%, #b3001b 60%, #7a0019 100%);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tarotGlow 2s ease-in-out infinite alternate;
}

@keyframes tarotGlow {
    from { box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4), 0 0 0 rgba(255, 196, 38, 0); }
    to { box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4), 0 0 14px rgba(255, 196, 38, 0.55); }
}

.tarot-card--flipped .tarot-card__back { animation: none; }

.tarot-card__back-frame {
    position: absolute;
    inset: 5px;
    border: 2px solid var(--fest-gold);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.tarot-card__back-ball {
    font-size: 1.5rem;
    filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.45));
}

.tarot-card__back-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--fest-gold);
    letter-spacing: 1px;
}

.tarot-card__face {
    transform: rotateY(180deg);
    background:
        radial-gradient(ellipse at 50% 20%, #fffdf6 0%, var(--fest-paper) 70%),
        var(--fest-paper);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 4px;
}

.tarot-card__face::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1.5px solid var(--fest-gold);
    border-radius: 7px;
    pointer-events: none;
}

.tarot-card__char {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    height: 58%;
    object-fit: contain;
    filter: drop-shadow(1px 1.5px 0 rgba(0, 0, 0, 0.35));
}

.tarot-card__name {
    position: relative;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 2px;
}

.tarot-card__score {
    position: relative;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--black);
    background: var(--fest-gold);
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 1px 10px;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.tarot-quote {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    min-height: 34px;
}

.tarot-quote__hint {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 244, 200, 0.85);
    align-self: center;
    animation: hintBlink 1.6s ease-in-out infinite;
}

@keyframes hintBlink {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.tarot-quote__avatar {
    width: 26px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.4));
}

.tarot-quote__bubble {
    background: var(--fest-paper);
    border: 2px solid var(--black);
    border-radius: 10px 10px 10px 2px;
    padding: 6px 10px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--black);
    line-height: 1.35;
}

.tarot-quote__bubble strong {
    color: var(--fest-magenta);
}

.tarot-quote--pop {
    animation: quotePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes quotePop {
    from { opacity: 0; transform: translateY(6px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tarotShuffle {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-5px) rotate(-3deg); }
    75% { transform: translateY(-2px) rotate(3deg); }
}

/* ═══════════════════ RESULT CARD CEREMONY ═══════════════════ */
.ceremony {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 8, 34, 0.88);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.ceremony--open { opacity: 1; }
.ceremony--closing { opacity: 0; }

.ceremony__rays {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 250vmax;
    height: 250vmax;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        rgba(255, 196, 38, 0.13) 0deg 7deg,
        transparent 7deg 16deg
    );
    animation: sunburstSpinCenter 28s linear infinite;
    pointer-events: none;
}

.ceremony--human .ceremony__rays {
    background: repeating-conic-gradient(
        rgba(245, 67, 174, 0.16) 0deg 7deg,
        rgba(255, 196, 38, 0.08) 7deg 11deg,
        transparent 11deg 16deg
    );
}

@keyframes sunburstSpinCenter {
    from { transform: translate(-50%, -50%) rotate(0); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.ceremony__ribbons {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ceremony__ribbon {
    position: absolute;
    top: -8%;
    width: 9px;
    height: 22px;
    border-radius: 3px;
    opacity: 0.9;
    animation: ribbonFall 2.8s linear infinite;
}

.ceremony__ribbon--0 { background: var(--fest-gold); }
.ceremony__ribbon--1 { background: var(--fest-pink); }
.ceremony__ribbon--2 { background: var(--fest-turquoise); }
.ceremony__ribbon--3 { background: var(--fest-orange); }
.ceremony__ribbon--4 { background: var(--fest-purple); }

@keyframes ribbonFall {
    0% { transform: translateY(0) rotate(0) skewX(0); }
    25% { transform: translateY(28vh) rotate(160deg) skewX(18deg); }
    50% { transform: translateY(56vh) rotate(300deg) skewX(-18deg); }
    100% { transform: translateY(115vh) rotate(560deg) skewX(10deg); opacity: 0.5; }
}

.ceremony__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px;
    perspective: 900px;
}

.ceremony__title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 6.5vw, 2.2rem);
    font-weight: 800;
    color: var(--fest-gold);
    text-shadow: 2.5px 2.5px 0 var(--black), 0 0 24px rgba(255, 196, 38, 0.5);
    letter-spacing: 1px;
    text-align: center;
    animation: stampIn 0.55s cubic-bezier(0.2, 1.8, 0.4, 1) 0.45s both;
}

.ceremony--ai .ceremony__title {
    color: #ff5e7a;
    text-shadow: 2.5px 2.5px 0 var(--black), 0 0 24px rgba(232, 51, 47, 0.55);
}

@keyframes stampIn {
    from { opacity: 0; transform: scale(2.6) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(-2deg); }
}

.ceremony__card {
    position: relative;
    width: min(74vw, 340px, 52dvh);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.65), 0 0 0 3px var(--black), 0 0 34px rgba(255, 196, 38, 0.35);
    animation: cardFlipIn 0.8s cubic-bezier(0.2, 1.25, 0.4, 1) both;
    transition: transform 0.12s ease-out;
    transform-style: preserve-3d;
}

@keyframes cardFlipIn {
    0% { opacity: 0; transform: rotateY(110deg) scale(0.55); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: rotateY(0) scale(1); }
}

.ceremony__card img {
    display: block;
    width: 100%;
    height: auto;
}

.ceremony__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, rgba(255, 255, 255, 0.1) 54%, transparent 70%);
    transform: translateX(-130%);
    animation: shineSweep 1.4s ease 0.75s;
    pointer-events: none;
}

@keyframes shineSweep {
    to { transform: translateX(130%); }
}

.ceremony__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ceremony__share {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 10px 24px;
    border: 2.5px solid var(--black);
    box-shadow: 3px 3px 0 var(--black);
    animation: stampIn 0.5s 0.9s cubic-bezier(0.2, 1.8, 0.4, 1) both;
}

.ceremony__hint {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    animation: hintBlink 1.6s ease-in-out 1.4s infinite both;
}

.live-sync-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    background: #e53935;
    border: 2px solid var(--black);
    border-radius: 999px;
    box-shadow: 2px 2px 0 var(--black);
    animation: livePulse 1.2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.match-scroll-card__live {
    display: block;
    font-size: 0.55rem;
    font-weight: 800;
    color: #ff5252;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ═══════════════════ FRIEND LEAGUE ═══════════════════ */
.league-panel {
    margin-bottom: 16px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(255, 196, 38, 0.15), rgba(245, 67, 174, 0.1));
    border: 3px solid var(--black);
    border-radius: 16px;
    box-shadow: 4px 4px 0 var(--black);
}

.league-panel__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--fest-gold);
    text-shadow: 1px 1px 0 var(--black);
    margin: 0 0 4px;
}

.league-panel__sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 12px;
}

.league-join {
    display: flex;
    gap: 8px;
}

.league-btn { flex: 1; font-size: 0.75rem; }

.league-active__meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.league-active__meta strong {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--fest-gold);
}

.league-active__code {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
}

.league-active__actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.league-board {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.league-row {
    display: grid;
    grid-template-columns: 28px 1fr 40px 44px;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.league-row--me {
    border-color: var(--fest-gold);
    background: rgba(255, 196, 38, 0.12);
}

.league-row__rank {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--fest-gold);
}

.league-row__name {
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.league-row__wins {
    color: #4ade80;
    text-align: center;
    font-size: 0.65rem;
}

.league-row__pts {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--fest-gold);
    text-align: right;
}

.league-empty {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

/* ═══════════════════ POSTER COLLECTION ALBUM ═══════════════════ */
.poster-album {
    margin-bottom: 16px;
}

.poster-album__head {
    margin-bottom: 10px;
}

.poster-album__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--golden-yellow);
    text-shadow: 1.5px 1.5px 0 var(--black);
}

.poster-album__sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
}

.poster-album__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.poster-tile {
    position: relative;
    aspect-ratio: 2 / 3;
    border: 2.5px solid var(--black);
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    background: #1d1136;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--black);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.poster-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-tile--unlocked:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--black);
}

.poster-tile--unlocked {
    box-shadow: 3px 3px 0 var(--black), 0 0 12px rgba(255, 196, 38, 0.35);
}

.poster-tile--locked img {
    filter: grayscale(1) brightness(0.42) sepia(0.35) hue-rotate(-20deg);
}

.poster-tile__name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 4px 5px;
    font-family: var(--font-display);
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 1px 1px 0 var(--black);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
    text-align: center;
    line-height: 1.15;
}

.poster-tile__lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    font-size: 1.4rem;
    filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.6));
}

.poster-tile__cond {
    position: absolute;
    left: 4px;
    right: 4px;
    top: 58%;
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--fest-gold);
    text-shadow: 1px 1px 0 var(--black);
    text-align: center;
    line-height: 1.2;
}

/* ═══════════════════ FULL-SCREEN IMAGE VIEWER ═══════════════════ */
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(10, 6, 24, 0.94);
    opacity: 0;
    transition: opacity 0.25s ease;
    touch-action: none;
}

.image-viewer--open { opacity: 1; }
.image-viewer--closing { opacity: 0; }

.image-viewer__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.image-viewer__stage:active { cursor: grabbing; }

.image-viewer__stage img {
    max-width: 96vw;
    max-height: 92dvh;
    border-radius: 10px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.7), 0 0 0 3px var(--black);
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
    animation: viewerIn 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
}

@keyframes viewerIn {
    from { opacity: 0; transform: scale(0.86); }
    to { opacity: 1; transform: scale(1); }
}

.image-viewer__close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 14px;
    z-index: 10;
    width: 42px;
    height: 42px;
    border: 2.5px solid var(--black);
    border-radius: 50%;
    background: var(--fest-gold);
    color: var(--black);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 2.5px 2.5px 0 var(--black);
}

/* ═══════════════════ CLASH HERO (group character art) ═══════════════════ */
.clash-hero {
    position: relative;
    margin: -4px -4px 4px;
    padding: 18px 10px 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.clash-hero__rays {
    position: absolute;
    left: 50%;
    top: 58%;
    width: 190%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        rgba(255, 196, 38, 0.2) 0deg 8deg,
        rgba(245, 67, 174, 0.08) 8deg 12deg,
        transparent 12deg 19deg
    );
    -webkit-mask-image: radial-gradient(circle, #000 28%, transparent 68%);
    mask-image: radial-gradient(circle, #000 28%, transparent 68%);
    animation: sunburstSpinCenter 32s linear infinite;
    pointer-events: none;
}

.clash-hero__art {
    position: relative;
    width: 100%;
    max-width: 420px;
    object-fit: contain;
    filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
    animation: heroBounceIn 0.7s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes heroBounceIn {
    from { opacity: 0; transform: translateY(24px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════ NEXT MATCH CARD ═══════════════════ */
.next-match-card-host { margin-bottom: 12px; }

.next-match-section__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    padding: 0 2px;
}

.next-match-section__title {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--fest-gold);
    text-shadow: 1px 1px 0 var(--black);
}

.next-match-section__date {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

.today-matches {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.today-matches__title {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.75);
    padding: 0 2px;
}

.today-matches__empty {
    margin: 6px 0 0;
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.today-match-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 6px;
    align-items: center;
    width: 100%;
    padding: 7px 8px;
    border: 2px solid var(--black);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    text-align: left;
    box-shadow: 2px 2px 0 var(--black);
    font-family: inherit;
}

.today-match-row:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--black); }
.today-match-row--done { opacity: 0.82; }
.today-match-row--locked { filter: grayscale(0.3); }
.today-match-row--live { border-color: #e53935; background: #fff5f5; }

.today-match-row__time {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--fest-deep-red);
}

.today-match-row__teams {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 0;
    color: var(--black);
    flex-wrap: wrap;
}

.today-match-row__teams img {
    width: 16px;
    height: 11px;
    object-fit: cover;
    border: 1px solid var(--black);
    border-radius: 2px;
    flex-shrink: 0;
}

.today-match-row__teams span:not(.today-match-row__vs) {
    line-height: 1.2;
}

.today-match-row__vs { opacity: 0.5; flex-shrink: 0; }

.today-match-row__status {
    font-size: 0.52rem;
    font-weight: 800;
    color: var(--fest-magenta);
    white-space: nowrap;
}

.next-match-card--live {
    border-color: #e53935;
    animation: nextMatchLive 1.4s ease-in-out infinite;
}

@keyframes nextMatchLive {
    0%, 100% { box-shadow: 5px 5px 0 var(--black); }
    50% { box-shadow: 5px 5px 0 var(--black), 0 0 14px rgba(229, 57, 53, 0.5); }
}

.next-match-card {
    background: linear-gradient(135deg, #fffbf2 0%, #ffe8f5 55%, #fff3c4 100%);
    border: 3px solid var(--black);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 5px 5px 0 var(--black);
    animation: nextMatchPulse 3s ease-in-out infinite;
}

.next-match-card--done { animation: none; opacity: 0.92; }
.next-match-card--locked { filter: grayscale(0.25); }
.next-match-card--empty {
    text-align: center;
    padding: 16px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.25);
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 14px;
}

@keyframes nextMatchPulse {
    0%, 100% { box-shadow: 5px 5px 0 var(--black); }
    50% { box-shadow: 5px 5px 0 var(--black), 0 0 18px rgba(245, 67, 174, 0.45); }
}

.next-match-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.next-match-card__label {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--fest-magenta);
}

.next-match-card__time {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--black);
    opacity: 0.7;
}

.next-match-card__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.next-match-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.next-match-card__name {
    color: var(--black);
    line-height: 1.2;
    max-width: 100%;
}

.next-match-card__star {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--black);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.next-match-card__flag {
    width: 32px;
    height: 22px;
    background-size: cover;
    background-position: center;
    border: 1.5px solid var(--black);
    border-radius: 3px;
}

.next-match-card__vs {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.9rem;
}

.next-match-card__foot {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.65);
}

.next-match-card__countdown {
    color: var(--fest-deep-red);
    font-weight: 800;
}

.next-match-card__cta {
    width: 100%;
    padding: 10px;
    border: 2.5px solid var(--black);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--fest-gold), #ffb300);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--black);
}

.next-match-card__cta:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.75;
}

.next-match-card__cta:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--black);
}

/* ═══════════════════ NEMESIS BADGE ═══════════════════ */
.map-nemesis {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 2px solid rgba(255, 196, 38, 0.6);
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.map-nemesis img {
    width: 28px;
    height: 36px;
    object-fit: contain;
}

.map-nemesis strong { color: var(--fest-gold); }

/* ═══════════════════ PER-AI RIVALRY ═══════════════════ */
.clash-rivalry-card { margin-bottom: 12px; }

.rivalry-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rivalry-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}

.rivalry-row--ahead { border-color: rgba(74, 222, 128, 0.45); }
.rivalry-row--behind { border-color: rgba(251, 113, 133, 0.5); }

.rivalry-row__avatar {
    width: 36px;
    height: 46px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.4));
}

.rivalry-row__body { flex: 1; min-width: 0; }

.rivalry-row__head {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.rivalry-row__pts {
    font-family: var(--font-display);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rivalry-row__bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.rivalry-row__bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--fest-turquoise), var(--fest-gold));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.rivalry-row--behind .rivalry-row__bar span {
    background: linear-gradient(90deg, var(--fest-pink), var(--fest-red));
}

.rivalry-row__record {
    display: flex;
    gap: 10px;
    font-size: 0.6rem;
    font-weight: 700;
}

.rivalry-row__w { color: #4ade80; }
.rivalry-row__t { color: #fbbf24; }
.rivalry-row__l { color: #fb7185; }

/* ═══════════════════ MATCH CARD EXTRAS ═══════════════════ */
.match-scroll-card__star {
    width: 22px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    border: 1.5px solid var(--black);
    margin-bottom: 2px;
}

.match-scroll-card__kickoff {
    display: block;
    font-size: 0.55rem;
    font-weight: 700;
    opacity: 0.85;
    margin-top: 2px;
}

.group-chip__pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--fest-pink);
    border: 2px solid var(--black);
    border-radius: 10px;
    font-size: 0.5rem;
    font-weight: 900;
    color: var(--white);
    animation: chipPulse 1.4s ease infinite;
}

@keyframes chipPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.battle-arena__lock-banner {
    text-align: center;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: rgba(232, 51, 47, 0.12);
    border: 2px solid var(--fest-red);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--fest-deep-red);
}

.battle-arena__score-input:disabled {
    opacity: 0.55;
    background: #eee;
}

/* ═══════════════════ CEREMONY EXTRAS ═══════════════════ */
.ceremony--tie .ceremony__title { color: var(--fest-turquoise); }
.ceremony__rival {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-top: -6px;
}
.ceremony__card--tie img { object-fit: contain; background: var(--fest-paper); }

body.ceremony-drumming {
    animation: drumrollShake 0.55s ease;
}

@keyframes drumrollShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-4px) rotate(-0.3deg); }
    30% { transform: translateX(4px) rotate(0.3deg); }
    45% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

/* ═══════════════════ ONBOARDING ═══════════════════ */
.onboarding {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 8, 34, 0.92);
}

.onboarding.hidden { display: none; }

.onboarding__card {
    width: min(100%, 360px);
    background: var(--fest-paper);
    border: 3px solid var(--black);
    border-radius: 20px;
    padding: 20px 18px 16px;
    box-shadow: 8px 8px 0 var(--black);
    text-align: center;
    color: var(--black);
}

.onboarding__step { display: none; }
.onboarding__step--active { display: block; animation: panelIn 0.3s ease; }

.onboarding__art {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.25));
}

.onboarding__art--solo { max-height: 120px; }
.onboarding__art--card { border-radius: 10px; border: 2px solid var(--black); }

.onboarding__league-badge {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(2px 2px 0 var(--black));
}

.onboarding__step h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 6px;
    color: var(--black);
}

.onboarding__step p {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--black);
    margin-bottom: 12px;
}

.onboarding__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 14px;
}

.onboarding__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--black);
    background: rgba(0, 0, 0, 0.15);
    padding: 0;
    cursor: pointer;
}

.onboarding__dot--active { background: var(--fest-gold); }

.onboarding__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.onboarding__actions .btn { flex: 1; max-width: 140px; }

/* ═══════════════════ FESTIVAL STAGE (home) ═══════════════════ */
.festival-stage {
    position: relative;
    margin: -4px -4px 14px;
    border-radius: 0 0 22px 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #3d1a5c 0%, #1a0a2e 70%, transparent 100%);
    border-bottom: 3px solid var(--fest-gold);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.festival-stage__rays {
    position: absolute;
    left: 50%;
    top: 30%;
    width: 180%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        rgba(255, 196, 38, 0.14) 0deg 7deg,
        rgba(245, 67, 174, 0.06) 7deg 11deg,
        transparent 11deg 18deg
    );
    animation: sunburstSpinCenter 40s linear infinite;
    pointer-events: none;
}

.festival-stage__border {
    height: 28px;
    background: url('assets/border.png') center/cover;
    opacity: 0.92;
    pointer-events: none;
}

.festival-stage__border--top { margin-bottom: -4px; }
.festival-stage__border--bottom { margin-top: -4px; }

.festival-stage__content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 8px 14px 14px;
}

.festival-stage__title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    font-weight: 800;
    color: var(--fest-gold);
    text-shadow: 2px 2px 0 var(--black), 0 0 20px rgba(255, 196, 38, 0.4);
    line-height: 1.1;
    margin: 0;
}

.festival-stage__sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 244, 220, 0.85);
    margin: 4px 0 8px;
}

.festival-stage__cast {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(6px, 3vw, 16px);
    width: min(100%, 340px);
    margin: 0 auto 10px;
    min-height: 120px;
    animation: stageCastIn 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

.festival-stage__char {
    height: clamp(100px, 28vw, 150px);
    width: auto;
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
    transform-origin: bottom center;
    animation: mascotIdle 2.6s ease-in-out infinite;
}

.festival-stage__char:nth-child(2) { animation-delay: 0.4s; }
.festival-stage__char:nth-child(3) { animation-delay: 0.9s; }

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

.festival-stage__stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.festival-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 196, 38, 0.5);
    border-radius: 12px;
}

.festival-stat__val {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--fest-gold);
    line-height: 1;
}

.festival-stat__lbl {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    margin-top: 2px;
}

.festival-stat--vs .festival-stat__record {
    display: flex;
    gap: 3px;
    margin-bottom: 2px;
}

.festival-stage__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.festival-stage__progress .campaign-progress__track {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid var(--black);
    border-radius: 6px;
}

.festival-stage__progress-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

.festival-stage__progress-lbl strong { color: var(--fest-gold); }

.festival-stage .map-nemesis {
    margin-top: 8px;
    justify-content: center;
}

/* ═══════════════════ FESTIVAL GATE (splash) ═══════════════════ */
.festival-gate {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0418;
    transition: opacity 0.7s ease;
}

.festival-gate.hidden { display: none; }
.festival-gate--out { opacity: 0; pointer-events: none; }

body.gate-open { overflow: hidden; }

.festival-gate__rays {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 250vmax;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        rgba(255, 196, 38, 0.18) 0deg 6deg,
        transparent 6deg 14deg
    );
    animation: sunburstSpinCenter 20s linear infinite;
}

.festival-gate__art {
    position: relative;
    width: min(85vw, 360px);
    object-fit: contain;
    filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.5));
    animation: gateArtIn 1s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

@keyframes gateArtIn {
    from { opacity: 0; transform: scale(0.6) translateY(40px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.festival-gate__title {
    position: relative;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    font-weight: 800;
    color: var(--fest-gold);
    text-shadow: 3px 3px 0 var(--black), 0 0 30px rgba(255, 196, 38, 0.6);
    margin: 16px 0 4px;
    animation: gateTitleIn 0.8s 0.3s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.festival-gate__sub {
    position: relative;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 244, 220, 0.9);
    animation: gateTitleIn 0.8s 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

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

/* Tablet pavilion centering */
@media (min-width: 768px) {
    .battle-sheet--pavilion {
        max-width: 480px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
    }
}

/* ═══════════════════ MOBILE RESPONSIVE ═══════════════════ */
@media (max-width: 767px) {
    .app-panel {
        padding: 10px max(10px, env(safe-area-inset-left)) 14px max(10px, env(safe-area-inset-right));
    }

    .app-header__title {
        font-size: 0.82rem;
    }

    .app-header__subtitle {
        font-size: 0.58rem;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .festival-stage__title {
        font-size: clamp(1.1rem, 5vw, 1.35rem);
    }

    .festival-stage__char {
        height: clamp(88px, 24vw, 130px);
    }

    .festival-stage__cast {
        gap: clamp(4px, 2vw, 12px);
    }

    .next-match-card__team {
        font-size: 0.65rem;
    }

    .next-match-card__name {
        word-break: break-word;
        hyphens: auto;
        line-height: 1.15;
    }

    .next-match-section__head {
        flex-wrap: wrap;
        gap: 4px;
    }

    .today-match-row {
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .today-match-row__time {
        grid-row: 1;
        grid-column: 1;
    }

    .today-match-row__status {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
        text-align: right;
        max-width: 42%;
        white-space: normal;
        line-height: 1.2;
    }

    .today-match-row__teams {
        grid-row: 2;
        grid-column: 1 / -1;
        font-size: 0.58rem;
    }

    .match-scroll-card__teams {
        gap: 4px;
        padding: 8px 8px 4px;
    }

    .match-scroll-card__name {
        font-size: 0.56rem;
    }

    .match-scroll-card__flag {
        width: 30px;
        height: 20px;
    }

    .map-phase-tab {
        padding: 10px 8px;
        font-size: 0.78rem;
    }

    .festival-poster-btn {
        padding: 8px 10px;
        gap: 8px;
    }

    .festival-poster-btn__text strong {
        font-size: 0.72rem;
        text-align: center;
    }

    .pavilion__frame {
        width: 100%;
        max-height: calc(100dvh - var(--header-h) - var(--bottom-nav-h) - 24px);
    }

    .pavilion__title {
        font-size: 0.9rem;
        padding: 10px 36px 4px;
    }

    .tarot-card {
        max-width: 96px;
    }

    .tarot-row {
        gap: 6px;
    }

    .battle-arena__name {
        font-size: 0.6rem;
    }

    .battle-arena__teams--compact .battle-arena__art--placeholder {
        width: 40px;
        height: 28px;
    }

    .battle-arena__score-input {
        width: 52px;
        font-size: 1.35rem;
    }

    .league-row {
        grid-template-columns: 24px minmax(0, 1fr) 36px 40px;
        font-size: 0.65rem;
        padding: 7px 8px;
    }

    .league-row__name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .league-join {
        flex-direction: column;
    }

    .league-btn {
        width: 100%;
    }

    .mascot-coach__text {
        font-size: 0.65rem;
    }

    .bottom-nav__btn {
        min-height: 44px;
        padding: 4px 2px;
    }

    .onboarding__card {
        width: min(100%, calc(100vw - 24px));
    }
}

@media (max-width: 360px) {
    .app-header__subtitle {
        display: none;
    }

    .app-header__score {
        padding: 2px 6px;
    }

    .app-header__score-value {
        font-size: 1rem;
    }

    .festival-stat {
        min-width: 48px;
        padding: 5px 7px;
    }

    .festival-stat__val {
        font-size: 1rem;
    }

    .record-pill {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    .group-chip {
        min-width: 42px;
        padding: 6px 8px 5px;
    }

    .next-match-card__teams {
        gap: 4px;
    }

    .next-match-card__name {
        font-size: 0.58rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .festival-stage__char,
    .mascot-coach__mini,
    .next-match-card,
    .festival-poster-btn__icon {
        animation: none !important;
    }
}
