:root {
    color-scheme: light;
    --match-bg: #fdf6f8;
    --match-ink: #2a2328;
    --match-muted: #6e626a;
    --match-panel: rgba(255, 255, 255, 0.96);
    --match-line: #eadde5;
    --match-pink: #f657b5;
    --match-pink-soft: #fff0f7;
    --match-blue: #4388f5;
    --match-green: #13a86a;
    --match-gold: #ffb82e;
    --match-deep: #d8648e;
    --match-purple: #7d59e8;
    --game-header-side-bg: var(--match-bg);
    --game-header-center-bg: #fff;
    --game-header-accent: var(--match-pink);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--match-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    letter-spacing: 0;
    background:
        linear-gradient(
            to right,
            var(--match-bg) 0,
            var(--match-bg) calc((100% - 450px) / 2),
            #fff calc((100% - 450px) / 2),
            #fff calc((100% + 450px) / 2),
            var(--match-bg) calc((100% + 450px) / 2),
            var(--match-bg) 100%
        );
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.match-shell {
    display: grid;
    place-items: start center;
    min-height: 100vh;
    padding: 8px 10px max(14px, env(safe-area-inset-bottom));
}

.match-stage {
    width: min(100%, 430px);
    padding-bottom: 14px;
}

.match-hud,
.goal-panel,
.match-actions {
    display: grid;
    gap: 8px;
}

.match-actions button,
.overlay-panel button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    background: var(--match-pink);
    box-shadow: 0 7px 16px rgba(216, 100, 142, 0.18);
    cursor: pointer;
}

.overlay-panel button[hidden] {
    display: none;
}

.overlay-panel > button {
    min-width: 108px;
    padding-right: 22px;
    padding-left: 22px;
}

.match-status {
    display: grid;
    grid-template-columns: minmax(56px, auto) minmax(0, 1fr) minmax(64px, auto);
    align-items: stretch;
    gap: 7px;
    margin-bottom: 8px;
}

.match-hud {
    display: contents;
}

.match-hud > div,
.goal-panel {
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 10px 24px rgba(216, 100, 142, 0.07);
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
}

.match-hud > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 6px 8px;
}

.match-hud > div:first-child,
.match-hud > div:nth-child(4) {
    display: none;
}

.match-hud > div:nth-child(2) {
    order: 1;
}

.match-hud > div:nth-child(3) {
    order: 3;
}

.match-hud span {
    color: var(--match-muted);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

.match-hud strong {
    min-width: 0;
    color: var(--match-ink);
    font-size: 17px;
    line-height: 1.08;
}

.goal-panel {
    order: 2;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 5px;
    align-items: center;
    column-gap: 7px;
    row-gap: 2px;
    min-width: 0;
    min-height: 44px;
    padding: 5px 8px 3px;
    overflow: hidden;
}

.goal-icon {
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--match-pink-soft);
    box-shadow: 0 5px 12px rgba(216, 100, 142, 0.18);
}

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

.goal-panel strong {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    color: var(--match-ink);
    font-size: 13px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.goal-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goal-count {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    flex: 0 0 auto;
    padding: 2px 6px 3px;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 45%),
        linear-gradient(135deg, var(--match-pink), var(--match-purple));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 4px 10px rgba(125, 89, 232, 0.2);
    text-shadow: 0 1px 2px rgba(42, 35, 40, 0.32);
}

.goal-count em {
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.goal-progress {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    position: relative;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #f1e7ed;
}

.goal-progress span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #efa4be, var(--match-pink));
    transition: width 180ms ease;
}

.coach-panel {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    width: 100%;
    min-height: 62px;
    margin: -1px 0 8px;
}

.coach-image {
    position: relative;
    z-index: 1;
    display: block;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid #fff;
    background: var(--match-pink-soft);
    box-shadow:
        0 8px 18px rgba(42, 35, 40, 0.16),
        0 0 0 1px rgba(246, 87, 181, 0.12);
    transition: transform 160ms ease, filter 160ms ease;
}

.coach-panel.is-reacting .coach-image {
    animation: coachReactPop 520ms cubic-bezier(0.18, 0.9, 0.22, 1.12);
}

.coach-panel[data-emotion="happy"] .coach-image,
.coach-panel[data-emotion="shy"] .coach-image {
    filter: brightness(1.06) saturate(1.08);
}

.coach-panel[data-emotion="sad"] .coach-image,
.coach-panel[data-emotion="sulk"] .coach-image {
    filter: saturate(0.92);
}

.coach-bubble {
    position: relative;
    min-width: 0;
    min-height: 54px;
    padding: 8px 10px 9px;
    border-radius: 8px;
    color: var(--match-ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 251, 0.76)),
        rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.76),
        0 9px 20px rgba(216, 100, 142, 0.08);
    backdrop-filter: blur(12px) saturate(1.04);
    -webkit-backdrop-filter: blur(12px) saturate(1.04);
}

.coach-bubble::before {
    content: "";
    position: absolute;
    left: -6px;
    bottom: 14px;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.86);
    transform: rotate(45deg);
    box-shadow: -1px 1px 0 rgba(255, 255, 255, 0.72);
}

.coach-bubble span {
    display: block;
    color: var(--match-green);
    font-size: 10px;
    font-weight: 1000;
    line-height: 1;
}

.coach-bubble p {
    display: -webkit-box;
    min-width: 0;
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--match-ink);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.board-frame {
    position: relative;
    width: min(100%, 430px);
    padding: 9px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 12% 0, rgba(246, 87, 181, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 246, 250, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.66);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 12px 28px rgba(216, 100, 142, 0.1);
    backdrop-filter: blur(12px) saturate(1.06);
    -webkit-backdrop-filter: blur(12px) saturate(1.06);
}

.board-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    aspect-ratio: 1;
    padding: 6px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.78), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 246, 250, 0.72)),
        rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.72);
    touch-action: none;
    user-select: none;
}

.board-grid.is-blasting {
    animation: boardBlastFlash 260ms ease;
}

.effects-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    border-radius: 8px;
    pointer-events: none;
}

.tile {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.86), transparent 19%),
        linear-gradient(180deg, var(--tile-light), var(--tile-color));
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.58),
        inset 0 -7px 12px rgba(65, 31, 50, 0.12),
        0 4px 9px rgba(42, 35, 40, 0.14);
    cursor: pointer;
    transition: transform 130ms ease, filter 130ms ease, opacity 150ms ease;
    will-change: transform, filter, opacity;
}

.tile:disabled {
    cursor: default;
}

.tile.is-selected {
    transform: translateY(-3px) scale(1.05);
    filter: brightness(1.12);
    outline: 3px solid rgba(246, 87, 181, 0.58);
    z-index: 2;
}

.tile.is-hint {
    animation: hintPulse 760ms ease-in-out 2;
}

.tile.is-clearing {
    z-index: 3;
    animation: tileClearPop 260ms cubic-bezier(0.14, 0.9, 0.28, 1) forwards;
}

.tile.is-drop {
    animation: tileDropPuni 360ms cubic-bezier(0.18, 0.9, 0.22, 1.12) both;
}

.tile.has-power {
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.68),
        inset 0 -8px 13px rgba(65, 31, 50, 0.13),
        0 5px 12px rgba(42, 35, 40, 0.16),
        0 0 0 2px rgba(255, 255, 255, 0.72),
        0 0 18px var(--tile-light);
}

.tile img {
    width: 82%;
    height: 82%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.88);
    pointer-events: none;
}

.power-badge {
    position: absolute;
    right: -3px;
    top: -4px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(20px, 34%, 30px);
    aspect-ratio: 1;
    border-radius: 50%;
    font-size: clamp(14px, 4.6vw, 21px);
    line-height: 1;
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.96) 0 18%, transparent 19%),
        linear-gradient(180deg, #fff, #fff1fb 42%, #ffb7dd);
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow:
        0 4px 9px rgba(42, 35, 40, 0.18),
        0 0 0 1px rgba(246, 87, 181, 0.14);
    transform-origin: 50% 74%;
    animation: powerBadgePuni 1280ms ease-in-out infinite;
    pointer-events: none;
}

.power-rainbow .power-badge {
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.96) 0 18%, transparent 19%),
        linear-gradient(135deg, #ff7db8 0 18%, #ffd36d 19% 38%, #74df9b 39% 58%, #79c8ff 59% 78%, #c9a5ff 79% 100%);
}

.power-candy .power-badge {
    color: #b9338a;
}

.tile::after {
    content: "";
    position: absolute;
    right: 8%;
    bottom: 8%;
    width: 18%;
    height: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    pointer-events: none;
}

.effect-ring,
.effect-spark,
.score-pop,
.combo-pop {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.effect-ring {
    width: 42px;
    height: 42px;
    border: 3px solid var(--effect-color, var(--match-pink));
    border-radius: 50%;
    box-shadow:
        0 0 0 5px rgba(255, 255, 255, 0.5),
        0 0 18px var(--effect-color, var(--match-pink));
    animation: effectRingBurst 420ms ease-out forwards;
}

.effect-spark {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff 0 24%, transparent 25%),
        var(--effect-color, var(--match-pink));
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.52),
        0 0 12px var(--effect-color, var(--match-pink));
    animation: effectSparkFly 520ms cubic-bezier(0.12, 0.82, 0.2, 1) forwards;
}

.score-pop {
    z-index: 5;
    padding: 4px 9px 5px;
    border-radius: 999px;
    color: #fff;
    font-size: 18px;
    font-weight: 1000;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 48%),
        linear-gradient(135deg, var(--match-gold), var(--match-pink));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        0 10px 20px rgba(246, 87, 181, 0.25);
    text-shadow: 0 2px 4px rgba(42, 35, 40, 0.3);
    animation: scorePopFloat 720ms cubic-bezier(0.16, 0.92, 0.28, 1) forwards;
}

.combo-pop {
    z-index: 5;
    min-width: 118px;
    padding: 5px 12px 6px;
    border-radius: 999px;
    color: #fff;
    font-size: 17px;
    font-weight: 1000;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 50%),
        linear-gradient(135deg, var(--match-purple), var(--match-pink));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 12px 24px rgba(125, 89, 232, 0.28);
    text-shadow: 0 2px 4px rgba(42, 35, 40, 0.3);
    animation: comboPopSlam 860ms cubic-bezier(0.16, 0.9, 0.24, 1) forwards;
}

.match-overlay {
    position: absolute;
    inset: 10px;
    z-index: 5;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(42, 35, 40, 0.34);
    backdrop-filter: blur(7px);
}

.match-overlay[hidden] {
    display: none;
}

.overlay-panel {
    width: min(88%, 310px);
    padding: 22px 18px 18px;
    border-radius: 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--match-line);
    box-shadow: 0 18px 36px rgba(42, 35, 40, 0.16);
}

.start-panel {
    width: min(84%, 292px);
    padding: 20px 18px 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 251, 0.82)),
        rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 18px 36px rgba(216, 100, 142, 0.16);
    backdrop-filter: blur(16px) saturate(1.08);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.start-panel::before {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: var(--match-pink);
}

.start-panel-icon {
    display: block;
    width: 54px;
    height: 54px;
    margin: 0 auto 10px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 18px rgba(216, 100, 142, 0.18);
}

.overlay-panel span {
    display: block;
    color: var(--match-pink);
    font-size: 11px;
    font-weight: 900;
}

.overlay-panel strong {
    display: block;
    margin-top: 4px;
    color: var(--match-ink);
    font-size: 24px;
    line-height: 1.18;
}

.overlay-panel p {
    margin: 10px 0 16px;
    color: var(--match-muted);
    font-size: 13px;
    line-height: 1.65;
}

.start-panel p {
    margin: 8px 0 16px;
    font-size: 12px;
    line-height: 1.72;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 12px;
}

.result-stats > div,
.global-grid > div {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 8px;
    background: rgba(255, 248, 251, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.result-stats dt,
.global-grid dt {
    margin: 0 0 3px;
    color: var(--match-muted);
    font-size: 10px;
    font-weight: 900;
}

.result-stats dd,
.global-grid dd {
    margin: 0;
    color: var(--match-ink);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
}

.match-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 10px;
}

.match-actions button {
    gap: 7px;
    min-width: 0;
    padding: 0 6px;
    color: var(--match-ink);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 8px 18px rgba(216, 100, 142, 0.06);
    backdrop-filter: blur(12px) saturate(1.04);
    -webkit-backdrop-filter: blur(12px) saturate(1.04);
}

.match-actions button::before {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 1000;
    line-height: 1;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 45%),
        linear-gradient(135deg, var(--match-pink), var(--match-purple));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 4px 9px rgba(125, 89, 232, 0.16);
}

#hintButton::before {
    content: "?";
}

#shuffleButton::before {
    content: "⇄";
}

#restartButton::before {
    content: "↻";
}

.global-panel {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.46);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.66),
        0 10px 22px rgba(216, 100, 142, 0.05);
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
}

.global-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.global-panel-head span {
    color: var(--match-deep);
    font-size: 14px;
    font-weight: 900;
}

.global-panel-head small {
    color: var(--match-muted);
    font-size: 11px;
    font-weight: 800;
}

.global-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
}

.is-busy .tile,
.is-ended .tile {
    pointer-events: none;
}

@keyframes hintPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.08);
        outline: 3px solid rgba(246, 87, 181, 0.58);
    }
}

@keyframes boardBlastFlash {
    0%,
    100% {
        filter: none;
    }
    42% {
        filter: brightness(1.08) saturate(1.14);
    }
}

@keyframes tileClearPop {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0);
        filter: brightness(1);
    }
    34% {
        opacity: 1;
        transform: scale(1.2) rotate(-4deg);
        filter: brightness(1.28) saturate(1.18);
    }
    100% {
        opacity: 0;
        transform: scale(0.12) rotate(18deg);
        filter: brightness(1.4) saturate(1.4);
    }
}

@keyframes tileDropPuni {
    0% {
        opacity: 0;
        transform: translateY(-52%) scaleX(0.84) scaleY(1.18);
        filter: brightness(1.1) saturate(1.08);
    }
    46% {
        opacity: 1;
        transform: translateY(8%) scaleX(1.14) scaleY(0.78);
        filter: brightness(1.05) saturate(1.08);
    }
    68% {
        transform: translateY(-4%) scaleX(0.95) scaleY(1.08);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: brightness(1) saturate(1);
    }
}

@keyframes powerBadgePuni {
    0%,
    100% {
        transform: rotate(-7deg) scale(1);
    }
    48% {
        transform: rotate(8deg) scale(1.1, 0.92);
    }
}

@keyframes coachReactPop {
    0% {
        transform: translateY(0) scale(1);
    }
    34% {
        transform: translateY(-5px) scale(1.08, 0.94);
    }
    62% {
        transform: translateY(2px) scale(0.98, 1.04);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes effectRingBurst {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.22);
    }
    72% {
        opacity: 0.82;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.62);
    }
}

@keyframes effectSparkFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.72);
    }
    76% {
        opacity: 0.95;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(0.18);
    }
}

@keyframes scorePopFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(8px) scale(0.7);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(-5px) scale(1.12);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-38px) scale(0.9);
    }
}

@keyframes comboPopSlam {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.58) rotate(-6deg);
    }
    16% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.12) rotate(2deg);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-24px) scale(0.82);
    }
}

@media (max-width: 520px) {
    body {
        background: #fff;
    }
}

@media (max-width: 370px) {
    .match-status {
        grid-template-columns: minmax(50px, auto) minmax(0, 1fr) minmax(58px, auto);
        gap: 6px;
    }

    .match-hud > div,
    .goal-panel {
        min-height: 40px;
    }

    .match-hud > div {
        padding-right: 6px;
        padding-left: 6px;
    }

    .match-hud strong {
        font-size: 15px;
    }

    .goal-panel {
        grid-template-columns: 28px minmax(0, 1fr);
        padding-right: 7px;
        padding-left: 7px;
    }

    .goal-icon {
        width: 26px;
        height: 26px;
    }

    .goal-panel strong {
        font-size: 12px;
    }

    .board-grid {
        gap: 4px;
        padding: 5px;
    }

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