/* =============================================
   Guild — War Games
   Sub-tabs + Simon board + game layout
   ============================================= */

/* ── Page header ── */
.wg-header svg {
    color: var(--color-primary);
}

/* ── Game sub-tabs ── */
.wg-game-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.wg-game-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 8px);
    background: var(--bg-input-faint);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    flex: 1 1 auto;
    min-width: 6rem;
    justify-content: center;
}

.wg-game-tab:hover {
    background: var(--bg-input-hover);
    color: var(--text-primary);
}

.wg-game-tab.active {
    background: var(--bg-primary-muted);
    border-color: var(--border-primary);
    color: var(--color-primary);
}

.wg-game-tab svg {
    flex-shrink: 0;
}

.wg-game-content {
    display: none;
}

.wg-game-content.active {
    display: block;
}

@media (max-width: 980px) {
    .wg-game-tab {
        flex-basis: calc(50% - 0.25rem);
    }
}

/* ── Game layout ── */
.wg-game-area {
    text-align: center;
}

/* ── Simon board ── */
.simon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.simon__hud {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.simon__score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--r, 10px);
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
}

.simon__score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.simon__score-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 0.2rem;
}

.simon__board {
    width: min(320px, 80vw);
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    border-radius: 50%;
    overflow: hidden;
    padding: 6px;
    background: var(--bg-dark);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--border-subtle);
    position: relative;
}

.simon__pad {
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.25;
    transition: opacity 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    outline: none;
}

.simon__pad:hover:not(.lit):not(:disabled) {
    opacity: 0.4;
    filter: brightness(1.1);
}

.simon__pad.lit {
    opacity: 1;
    box-shadow: 0 0 24px currentColor, inset 0 0 12px rgba(255, 255, 255, 0.3);
    filter: brightness(1.5);
}

.simon__pad:disabled {
    cursor: default;
}

.simon__pad--tank {
    background: var(--color-role-tank);
    color: var(--color-role-tank);
    border-top-left-radius: 100% 100%;
}

.simon__pad--healer {
    background: var(--color-role-healer);
    color: var(--color-role-healer);
    border-top-right-radius: 100% 100%;
}

.simon__pad--melee {
    background: var(--color-role-melee);
    color: var(--color-role-melee);
    border-bottom-left-radius: 100% 100%;
}

.simon__pad--ranged {
    background: var(--color-role-ranged);
    color: var(--color-role-ranged);
    border-bottom-right-radius: 100% 100%;
}

.simon__hud-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.simon__status {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-height: 1.4em;
    text-align: center;
}

.simon__status--error {
    color: var(--color-danger);
}

.simon__start {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--r, 8px);
    transition: opacity 0.2s, background 0.2s;
}

.simon__start:disabled {
    opacity: 0.4;
    cursor: default;
}

.simon__doc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 30rem;
    line-height: 1.5;
}

@media (max-width: 980px) {
    .simon__board {
        width: min(280px, 90vw);
    }
}

/* =============================================
   Parry / Counter game
   ============================================= */

.parry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.parry__hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.parry__pat-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    min-height: 1.4em;
}

.parry__hud-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.parry__score-box {
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 10px);
    padding: 0.4rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5rem;
}

.parry__score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.parry__score-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 0.15rem;
}

.parry__arena {
    position: relative;
    width: min(280px, 78vw);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    --pattern-color: var(--color-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.12s ease;
}

.parry__arena--charging {
    box-shadow: 0 0 28px -4px var(--pattern-color), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.parry__arena--window {
    box-shadow: 0 0 36px 2px var(--pattern-color), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.parry__arena--hit {
    animation: parry-arena-shake 0.45s ease-out;
}

@keyframes parry-arena-shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-6px, 3px); }
    20% { transform: translate(5px, -4px); }
    30% { transform: translate(-4px, -3px); }
    40% { transform: translate(4px, 2px); }
    50% { transform: translate(-3px, -1px); }
    60% { transform: translate(2px, 1px); }
    70% { transform: translate(-1px, 0); }
}

.parry__telegraph {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 76%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--pattern-color, var(--color-primary));
    opacity: var(--p, 0);
    transform: scale(calc(1.4 - 0.55 * var(--p, 0)));
    pointer-events: none;
    transition: transform 0.04s linear, opacity 0.04s linear;
}

.parry__pulse {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 76%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid var(--pattern-color, var(--color-primary));
    opacity: 0;
    pointer-events: none;
}

.parry__pulse--go {
    animation: parry-pulse 0.28s ease-out;
}

@keyframes parry-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.75); opacity: 0; }
}

.parry__boss {
    width: 50%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: var(--r, 12px);
    position: relative;
    z-index: 2;
    transition: transform 0.15s;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.parry__boss--success {
    animation: parry-boss-success 0.45s ease-out;
}

.parry__boss--hit {
    animation: parry-boss-hit 0.5s ease-out;
}

@keyframes parry-boss-success {
    0%   { transform: scale(1); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
    25%  { transform: scale(1.4); filter: drop-shadow(0 0 20px var(--color-success)) sepia(1) hue-rotate(50deg) saturate(1.8); }
    100% { transform: scale(1); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
}

@keyframes parry-boss-hit {
    0%, 100% { transform: translate(0, 0); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
    15% { transform: translate(-5px, 2px); filter: drop-shadow(0 0 16px var(--color-danger)) sepia(1) hue-rotate(-30deg) saturate(2.5); }
    30% { transform: translate(5px, -2px); filter: drop-shadow(0 0 16px var(--color-danger)) sepia(1) hue-rotate(-30deg) saturate(2.5); }
    45% { transform: translate(-3px, -2px); filter: drop-shadow(0 0 16px var(--color-danger)) sepia(1) hue-rotate(-30deg) saturate(2.5); }
    60% { transform: translate(3px, 1px);  filter: drop-shadow(0 0 16px var(--color-danger)) sepia(1) hue-rotate(-30deg) saturate(2.5); }
    80% { transform: translate(-1px, 0);   filter: drop-shadow(0 0 16px var(--color-danger)) sepia(1) hue-rotate(-30deg) saturate(2.5); }
}

.parry__status {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    min-height: 1.4em;
    text-align: center;
}

.parry__status--error {
    color: var(--color-danger);
}

.parry__status--success {
    color: var(--color-success);
}

.parry__preview {
    position: relative;
    width: min(420px, 90vw);
    height: 26px;
    margin: 0 auto;
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill, 999px);
    --pattern-color: var(--color-primary);
}

.parry__preview::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    top: 50%;
    height: 2px;
    background: var(--border-subtle);
    transform: translateY(-50%);
}

.parry__preview-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pattern-color);
    opacity: 0.4;
    z-index: 1;
    transition: transform 0.1s ease, opacity 0.1s ease, box-shadow 0.1s ease;
}

.parry__preview-dot.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.6);
    box-shadow: 0 0 14px var(--pattern-color);
}

.parry__controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.parry__start {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--r, 8px);
    transition: opacity 0.2s, background 0.2s;
}

.parry__start:disabled {
    opacity: 0.4;
    cursor: default;
}

.parry__parry-btn {
    padding: 0.55rem 2.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    border: 2px solid var(--border-primary);
    border-radius: var(--r, 8px);
    background: var(--bg-primary-faint);
    color: var(--color-primary);
    cursor: pointer;
    user-select: none;
    transition: transform 0.05s ease, background 0.15s;
}

.parry__parry-btn:active {
    transform: scale(0.96);
    background: var(--bg-primary-muted);
}

.parry__doc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 32rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 980px) {
    .parry__arena {
        width: min(260px, 82vw);
    }
    .parry__preview {
        width: 90vw;
    }
}

/* =============================================
   War Games — Rankings
   ============================================= */

.wg-rankings {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.wg-ranking-section {
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 14px);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wg-ranking-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.wg-ranking-section__title svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.wg-ranking-section__hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.wg-ranking-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

.wg-ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.wg-ranking-table thead th {
    text-align: left;
    padding: 0.55rem 0.6rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
}

.wg-ranking-table tbody td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.wg-ranking-table tbody tr:last-child td {
    border-bottom: none;
}

.wg-ranking-table tbody tr:hover {
    background: var(--bg-primary-faint);
}

.wg-ranking-table__pos {
    width: 2.5rem;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.wg-ranking-table__player {
    font-weight: 600;
}

.wg-ranking-table__score,
.wg-ranking-table__points {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.wg-ranking-table__points {
    color: var(--color-primary);
}

.wg-ranking-table__date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wg-ranking-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--r, 8px);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-input-faint);
}

.wg-ranking-badge--1 {
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    color: #422006;
}

.wg-ranking-badge--2 {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    color: #1f2937;
}

.wg-ranking-badge--3 {
    background: linear-gradient(135deg, #cd7f32, #a05a1a);
    color: #fff;
}

@media (max-width: 980px) {
    .wg-ranking-section {
        padding: 1rem;
    }

    .wg-ranking-table {
        font-size: 0.82rem;
    }

    .wg-ranking-table thead th,
    .wg-ranking-table tbody td {
        padding: 0.45rem 0.4rem;
    }
}

/* =============================================
   Ghost game — Mirfa's Ghost
   Character at center, ghosts orbit, aim with mouse to disable
   ============================================= */

.ghost {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.ghost__hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ghost__hud-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.ghost__score-box {
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 10px);
    padding: 0.4rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5rem;
}

.ghost__score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ghost__score-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 0.15rem;
}

.ghost__arena {
    position: relative;
    width: min(460px, 85vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--bg-primary-faint) 0%, var(--bg-dark) 72%);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    cursor: crosshair;
}

/* faint vision ring around the character */
.ghost__arena::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 68%;
    height: 68%;
    border-radius: 50%;
    border: 1px dashed var(--border-subtle);
    transform: translate(-50%, -50%);
    opacity: 0.5;
    pointer-events: none;
}

.ghost__character {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-primary-muted);
    border: 2px solid var(--border-primary);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 0 14px -2px var(--color-primary);
}

.ghost__beam {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52%;
    height: 4px;
    margin-top: -2px;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    border-radius: var(--r, 2px);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.08s ease;
}

.ghost__beam--active {
    opacity: 0.9;
}

.ghost__ghost {
    position: absolute;
    width: var(--ghost-size, 56px);
    height: var(--ghost-size, 56px);
    margin-left: calc(var(--ghost-size, 56px) / -2);
    margin-top: calc(var(--ghost-size, 56px) / -2);
    color: var(--ghost-color, #4caf50);
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 0 6px currentColor);
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Phantom variant: heavier aura */
.ghost__ghost--phantom {
    filter: drop-shadow(0 0 10px currentColor);
}

/* Wraith variant: leaner, sharper glow */
.ghost__ghost--wraith .ghost__ghost-ring {
    stroke-width: 2.5;
}

/* Specter variant: trailing motion blur */
.ghost__ghost--specter {
    filter: drop-shadow(0 0 5px currentColor) blur(0.4px);
}

.ghost__ghost--in {
    opacity: 1;
    transform: scale(1);
    animation: ghost-pop 0.18s ease-out;
}

.ghost__ghost--charging {
    animation: ghost-charge 0.25s ease-in-out infinite alternate;
}

.ghost__ghost--charging .ghost__ghost-ring {
    stroke-width: 4;
    opacity: 1;
}

.ghost__ghost--urgent {
    animation: ghost-shiver 0.22s infinite;
}

.ghost__ghost--cleared {
    opacity: 0;
    transform: scale(1.6);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ghost__ghost--failed {
    animation: ghost-fail 0.45s ease-out forwards;
}

.ghost__ghost-ring {
    opacity: 0.85;
}

@keyframes ghost-pop {
    0% { transform: scale(0.2); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ghost-shiver {
    0%, 100% { transform: scale(1) translate(0, 0); }
    25% { transform: scale(0.97) translate(-1px, 0); }
    75% { transform: scale(0.97) translate(1px, 0); }
}

@keyframes ghost-fail {
    0%   { transform: scale(1) rotate(0); opacity: 1; }
    25%  { transform: scale(1.1) rotate(-6deg); opacity: 1; }
    50%  { transform: scale(0.95) rotate(4deg); opacity: 0.6; }
    100% { transform: scale(1.2) rotate(0); opacity: 0; }
}

@keyframes ghost-charge {
    from { filter: drop-shadow(0 0 6px currentColor); }
    to   { filter: drop-shadow(0 0 22px currentColor) brightness(1.35); }
}

.ghost__status {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-height: 1.4em;
}

.ghost__status--error {
    color: var(--color-danger);
}

.ghost__controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.ghost__start {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--r, 8px);
    transition: opacity 0.2s, background 0.2s;
}

.ghost__start:disabled {
    opacity: 0.4;
    cursor: default;
}

.ghost__doc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 38rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 980px) {
    .ghost__arena {
        width: min(400px, 90vw);
    }
}

/* =============================================
   Interrupt Trainer game
   ============================================= */

.interrupt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.interrupt__hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.interrupt__hud-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.interrupt__score-box {
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 10px);
    padding: 0.4rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5rem;
}

.interrupt__score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.interrupt__score-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 0.15rem;
}

.interrupt__arena {
    position: relative;
    width: min(400px, 82vw);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-radius: var(--r, 16px);
    background: radial-gradient(circle at center, var(--bg-primary-faint) 0%, var(--bg-dark) 70%);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.interrupt__enemy {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.15s ease, filter 0.15s ease, color 0.2s ease;
    z-index: 2;
}

.interrupt__enemy--idle {
    color: var(--text-muted);
}

.interrupt__enemy--casting {
    color: #f59e0b;
    filter: drop-shadow(0 0 12px #f59e0b);
    animation: interrupt-enemy-cast 0.6s ease-in-out infinite alternate;
}

.interrupt__enemy--success {
    color: var(--color-success, #22c55e);
    filter: drop-shadow(0 0 18px #22c55e);
    transform: scale(0.8);
    transition: transform 0.12s ease, filter 0.12s ease;
}

.interrupt__enemy--resisted {
    color: #818cf8;
    filter: drop-shadow(0 0 14px #818cf8);
}

.interrupt__enemy--hit {
    color: var(--color-danger, #ef4444);
    filter: drop-shadow(0 0 18px #ef4444);
    animation: interrupt-enemy-hit 0.5s ease-out forwards;
}

@keyframes interrupt-enemy-cast {
    from { transform: scale(1); filter: drop-shadow(0 0 8px #f59e0b); }
    to   { transform: scale(1.08); filter: drop-shadow(0 0 18px #f59e0b) brightness(1.15); }
}

@keyframes interrupt-enemy-hit {
    0%   { transform: scale(1) translate(0,0); }
    20%  { transform: scale(1.15) translate(-6px, 2px) rotate(5deg); }
    40%  { transform: scale(0.9) translate(5px, -3px) rotate(-4deg); }
    60%  { transform: scale(1.05) translate(-3px, 1px); }
    80%  { transform: scale(0.95) translate(1px, 0); }
    100% { transform: scale(1) translate(0,0); opacity: 0.6; }
}

.interrupt__cast {
    width: 86%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 3;
}

.interrupt__cast[hidden] {
    display: none;
}

.interrupt__cast-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.interrupt__cast-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
    flex-shrink: 0;
}

.interrupt__cast-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    truncate: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interrupt__cast-timer {
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.interrupt__cast-bar {
    position: relative;
    width: 100%;
    height: 22px;
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 6px);
    overflow: hidden;
}

.interrupt__cast-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 5px 0 0 5px;
    transition: width 0.02s linear;
}

.interrupt__cast--interrupted .interrupt__cast-progress {
    background: var(--color-success, #22c55e);
    width: 100% !important;
}

.interrupt__cast--landed .interrupt__cast-progress {
    background: var(--color-danger, #ef4444);
    width: 100% !important;
}

.interrupt__cast--baited .interrupt__cast-progress {
    background: #818cf8;
}

.interrupt__cast--feint-cancelled .interrupt__cast-progress {
    opacity: 0.4;
}

.interrupt__cast-fake {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--r, 6px);
}

.interrupt__cast-fake--flash {
    animation: interrupt-flash 0.25s ease-out;
}

.interrupt__cast-fake--flash-red {
    box-shadow: inset 0 0 0 3px var(--color-danger, #ef4444);
    animation: interrupt-flash-red 0.3s ease-out;
}

@keyframes interrupt-flash {
    0%   { box-shadow: inset 0 0 0 3px rgba(129,140,248,0.9); }
    100% { box-shadow: inset 0 0 0 0px rgba(129,140,248,0); }
}

@keyframes interrupt-flash-red {
    0%   { box-shadow: inset 0 0 0 3px rgba(239,68,68,0.9); }
    100% { box-shadow: inset 0 0 0 0px rgba(239,68,68,0); }
}

.interrupt__hint {
    width: 80%;
    text-align: center;
    min-height: 1.2rem;
    z-index: 2;
}

.interrupt__hint span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.interrupt__status {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-height: 1.4em;
    text-align: center;
}

.interrupt__status--error {
    color: var(--color-danger, #ef4444);
}

.interrupt__controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.interrupt__start {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--r, 8px);
    transition: opacity 0.2s, background 0.2s;
}

.interrupt__start:disabled {
    opacity: 0.4;
    cursor: default;
}

.interrupt__kick-btn {
    padding: 0.55rem 2.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    border: 2px solid var(--border-primary);
    border-radius: var(--r, 8px);
    background: var(--bg-primary-faint);
    color: var(--color-primary);
    cursor: pointer;
    user-select: none;
    transition: transform 0.05s ease, background 0.15s;
}

.interrupt__kick-btn:active {
    transform: scale(0.96);
    background: var(--bg-primary-muted);
}

.interrupt__doc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 38rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 980px) {
    .interrupt__arena {
        width: min(340px, 88vw);
    }
}

/* =============================================
   Dodge game — Don't Stand in Fire
   ============================================= */

.dodge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.dodge__hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.dodge__hud-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dodge__score-box {
    background: var(--bg-input-faint);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 10px);
    padding: 0.4rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5rem;
}

.dodge__score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.dodge__score-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 0.15rem;
}

.dodge__hint-row {
    margin-top: 0.2rem;
}

.dodge__hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dodge__arena {
    position: relative;
    width: min(440px, 85vw);
    aspect-ratio: 1;
    border-radius: var(--r, 12px);
    background:
        radial-gradient(circle at center, var(--bg-dark) 0%, #0a0a0a 100%);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    cursor: crosshair;
}

.dodge__arena::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.dodge__character {
    position: absolute;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    margin-top: -16px;
    border-radius: 50%;
    background: var(--bg-primary-muted);
    border: 2px solid var(--border-primary);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 12px -2px var(--color-primary);
    transition: box-shadow 0.1s ease;
}

.dodge__character--hit {
    border-color: var(--color-danger, #ef4444);
    color: var(--color-danger, #ef4444);
    box-shadow: 0 0 24px 4px var(--color-danger, #ef4444);
    animation: dodge-hit 0.4s ease-out;
}

@keyframes dodge-hit {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.dodge__hazard {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.dodge__hazard--telegraph {
    opacity: 0.45;
    transform: scale(1);
    border: 2px dashed hsl(var(--hazard-hue), 70%, 55%);
    background: hsl(var(--hazard-hue), 60%, 45%, 0.12);
    animation: dodge-telegraph 0.4s ease-in-out infinite alternate;
}

@keyframes dodge-telegraph {
    from { opacity: 0.3; }
    to   { opacity: 0.6; }
}

.dodge__hazard--active {
    opacity: 1;
    transform: scale(1);
    border: none;
}

.dodge__hazard--fire.dodge__hazard--active {
    background: radial-gradient(circle, hsl(18, 90%, 50%) 0%, hsl(18, 80%, 35%) 70%, transparent 100%);
    box-shadow: 0 0 20px hsl(18, 90%, 50%);
    animation: dodge-fire-flicker 0.18s infinite;
}

.dodge__hazard--void.dodge__hazard--active {
    background: radial-gradient(circle, hsl(280, 80%, 45%) 0%, hsl(280, 70%, 25%) 60%, transparent 100%);
    box-shadow: 0 0 18px hsl(280, 80%, 50%);
}

.dodge__hazard--swirl.dodge__hazard--active {
    background: radial-gradient(circle, hsl(200, 85%, 55%) 0%, hsl(200, 70%, 35%) 60%, transparent 100%);
    box-shadow: 0 0 16px hsl(200, 85%, 55%);
    animation: dodge-swirl-rotate 0.3s linear infinite;
}

@keyframes dodge-fire-flicker {
    0%   { filter: brightness(1); }
    50%  { filter: brightness(1.2); }
    100% { filter: brightness(0.9); }
}

@keyframes dodge-swirl-rotate {
    from { transform: scale(1) rotate(0deg); }
    to   { transform: scale(1) rotate(360deg); }
}

.dodge__hazard--chains.dodge__hazard--active {
    background: transparent;
    border: 4px solid hsl(45, 85%, 55%);
    box-shadow: 0 0 20px hsl(45, 85%, 50%), inset 0 0 12px hsl(45, 80%, 40%);
}

.dodge__hazard--chains.dodge__hazard--active::after {
    content: "";
    position: absolute;
    inset: 50%;
    width: 30%;
    height: 30%;
    margin-left: -15%;
    margin-top: -15%;
    border-radius: 50%;
    background: transparent;
}

.dodge__hazard--fade {
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.dodge__status {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-height: 1.4em;
    text-align: center;
}

.dodge__status--error {
    color: var(--color-danger, #ef4444);
}

.dodge__controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.dodge__start {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--r, 8px);
    transition: opacity 0.2s, background 0.2s;
}

.dodge__start:disabled {
    opacity: 0.4;
    cursor: default;
}

.dodge__doc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 38rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 980px) {
    .dodge__arena {
        width: min(360px, 90vw);
    }
}
