/* Board and match rendering. These rules describe game surfaces, not the application theme. */
.mg-puzzle-app{min-height:calc(100vh - 150px);display:grid;grid-template-columns:minmax(320px,430px) 1fr;gap:24px;margin-top:16px}.mg-puzzle-panel{padding:24px;overflow:auto}.mg-puzzle-panel h1{margin:0 0 8px;font-size:clamp(28px,4vw,46px);line-height:1}.mg-puzzle-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.mg-puzzle-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:16px 0}.mg-puzzle-stats span{padding:12px;text-align:center}.mg-puzzle-nav{display:flex;flex-direction:column;gap:10px;margin-top:18px}.mg-puzzle-stage{position:relative;min-height:620px;display:grid;place-items:center;padding:24px;overflow:hidden}.mg-puzzle-board{width:min(78vmin,760px);aspect-ratio:1/1;display:grid;gap:clamp(2px,.5vmin,6px);background:rgba(0,0,0,.5);padding:clamp(4px,.8vmin,10px);border-radius:22px;touch-action:manipulation}.mg-tile{min-width:0;min-height:0;padding:0;border-radius:clamp(6px,1vmin,14px);background-repeat:no-repeat;background-size:cover;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22),0 6px 14px rgba(0,0,0,.28)}.mg-tile.blank{background:rgba(255,255,255,.08);box-shadow:inset 0 0 0 2px rgba(255,255,255,.12)}body.mg-ui-mobile .mg-puzzle-app{grid-template-columns:1fr}body.mg-ui-mobile .mg-puzzle-stage{min-height:auto}body.mg-ui-mobile .mg-puzzle-board{width:min(94vw,680px)}

.mg-puzzle-app {
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    align-items: start;
}

.mg-puzzle-panel,.mg-puzzle-stage {
    min-width: 0;
    max-width: 100%;
}

.mg-puzzle-stage {
    width: 100%;
    min-height: auto;
    padding: clamp(10px, 2vw, 24px);
    overflow: visible;
}

.mg-puzzle-board {
    width: min(100%, 760px, 72vh, 78vmin);
    max-width: 100%;
    margin-inline: auto;
}

.mg-puzzle-board[data-size="5"],
.mg-puzzle-board[data-size="8"] {
    gap: clamp(1px, .28vmin, 4px);
    padding: clamp(3px, .55vmin, 8px);
}

.mg-puzzle-board[data-size="8"] {
    border-radius: 14px;
}

.mg-puzzle-board[data-size="8"] .mg-tile {
    border-radius: clamp(3px, .55vmin, 8px);
}
    body.mg-ui-mobile .mg-puzzle-app{
        grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
        gap: 16px;
    }

    body.mg-ui-mobile .mg-puzzle-board{
        width: min(100%, 680px, 70vh, 76vmin);
    }

    body.mg-ui-mobile .mg-puzzle-app{
        grid-template-columns: 1fr;
    }

    body.mg-ui-mobile .mg-puzzle-stage{
        padding: 10px;
    }

    body.mg-ui-mobile .mg-puzzle-board{
        width: min(100%, calc(100dvw - 44px), 680px);
        max-height: none;
    }

    body.mg-ui-mobile .mg-puzzle-panel{
        padding: 16px;
    }

    body.mg-ui-mobile .mg-puzzle-stats{
        grid-template-columns: 1fr;
    }

    body.mg-ui-mobile .mg-puzzle-board{
        width: min(100%, calc(100dvw - 36px));
        border-radius: 16px;
    }
.mg-puzzle-app-minimal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: auto;
    width: min(100%, 900px);
    margin-inline: auto;
}

.mg-puzzle-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #151515;
    color: #f4efe7;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    padding: 10px;
}

.mg-puzzle-counter {
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 110px;
    text-align: center;
}

.mg-puzzle-app-minimal .mg-puzzle-stage {
    min-height: min(78dvh, 780px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: clamp(8px, 2vw, 18px);
}

.mg-puzzle-app-minimal .mg-puzzle-board {
    width: min(100%, calc(100dvw - 48px), calc(100dvh - 190px), 760px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
}

.mg-puzzle-app-minimal .mg-preview-wrap {
    display: grid;
    gap: 18px;
    grid-template-rows: minmax(0, 1fr) auto;
    inset: clamp(8px, 2vw, 18px);
    padding: clamp(12px, 2vw, 24px);
}

.mg-puzzle-app-minimal .mg-preview-wrap:not(.show) {
    display: none;
}

.mg-puzzle-app-minimal .mg-preview-wrap img {
    max-width: min(100%, calc(100dvw - 72px), 720px);
    max-height: min(100%, calc(100dvh - 260px), 720px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.mg-puzzle-start {
    justify-self: center;
    min-width: 160px;
}

.mg-puzzle-complete {
    display: grid;
    gap: 16px;
    max-width: 460px;
    padding: 24px;
    text-align: center;
}

.mg-puzzle-complete[hidden] {
    display: none;
}
    body.mg-ui-mobile .mg-puzzle-topbar{
        justify-content: stretch;
    }

    body.mg-ui-mobile .mg-puzzle-counter,body.mg-ui-mobile .mg-puzzle-topbar button{
        flex: 1 1 auto;
    }

    body.mg-ui-mobile .mg-puzzle-app-minimal .mg-puzzle-board{
        width: min(100%, calc(100dvw - 32px), calc(100dvh - 190px));
    }
.mg-connect-level-grid {
    display: grid;
    gap: 14px;
}

.mg-connect-level-card {
    background: #fff;
}

.mg-connect-stage {
    align-content: center;
    gap: 18px;
}

.mg-connect-board-wrap {
    display: grid;
    gap: 14px;
    justify-items: center;
    width: min(100%, 760px);
}

.mg-connect-board {
    position: relative;
    display: grid;
    width: min(100%, calc(100dvw - 48px), calc(100dvh - 210px), 760px);
    aspect-ratio: 1 / 1;
    background: #f7fafc;
    border: 2px solid rgba(23,32,51,.2);
    border-radius: 22px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 22px 70px rgba(0,0,0,.18);
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

.mg-connect-board::after {
    content: attr(data-message);
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 8;
    transform: translateX(-50%);
    background: rgba(23,32,51,.9);
    color: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: .9rem;
    pointer-events: none;
    opacity: 0;
}

.mg-connect-board[data-message]::after {
    opacity: 1;
}

.mg-connect-cell {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid rgba(23,32,51,.1);
    border-bottom: 1px solid rgba(23,32,51,.1);
}

.mg-connect-cell.is-visited::before {
    content: "";
    width: 32%;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: rgba(36,87,214,.18);
}

.mg-connect-cell.is-current::before {
    background: rgba(36,87,214,.34);
}

.mg-connect-marker {
    position: absolute;
    z-index: 6;
    display: grid;
    place-items: center;
    width: clamp(24px, calc(42px - var(--connect-size, 6) * 1.4px), 38px);
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: #172033;
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    font-weight: 800;
    font-size: clamp(.78rem, calc(1.15rem - var(--connect-size, 6) * .03rem), 1.1rem);
}

.mg-connect-cell.is-visited .mg-connect-marker,
.mg-connect-cell.is-current .mg-connect-marker {
    background: #2457d6;
}

.mg-connect-line-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mg-connect-line {
    fill: none;
    stroke: #2457d6;
    stroke-width: .16;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 .04px .08px rgba(0,0,0,.3));
}

.mg-connect-board:not(.is-playing) .mg-connect-line,
.mg-connect-board:not(.is-playing) .mg-connect-cell.is-visited::before {
    display: none;
}

.mg-connect-start {
    min-width: 180px;
}
    body.mg-ui-mobile .mg-connect-board{
        width: min(100%, calc(100dvw - 32px), calc(100dvh - 210px));
        border-radius: 16px;
    }

    body.mg-ui-mobile .mg-connect-marker{
        border-width: 2px;
    }

.mg-connect-cell { z-index: 5; }
.mg-connect-line-layer { z-index: 4; }
.mg-connect-editor{display:grid;gap:14px;margin:18px 0}
.mg-connect-editor-toolbar,.mg-connect-editor-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.mg-connect-editor-main{display:grid;grid-template-columns:minmax(280px,620px) minmax(220px,1fr);gap:18px;align-items:start}
.mg-connect-editor-board{position:relative;display:grid;width:min(100%,620px);aspect-ratio:1/1;background:#f7fafc;border:2px solid rgba(23,32,51,.22);border-radius:18px;overflow:hidden;touch-action:none;user-select:none}
.mg-connect-editor-cell{position:relative;z-index:5;display:grid;place-items:center;border:0;border-right:1px solid rgba(23,32,51,.12);border-bottom:1px solid rgba(23,32,51,.12);background:transparent;padding:0;cursor:pointer;color:#172033}
.mg-connect-editor-cell:hover{background:rgba(36,87,214,.08)}
.mg-connect-editor-cell.is-path::before{content:"";position:absolute;width:30%;aspect-ratio:1/1;border-radius:999px;background:rgba(36,87,214,.16)}
.mg-connect-editor-cell.is-last::before{background:rgba(36,87,214,.32)}
.mg-connect-editor-cell.is-barrier-start{box-shadow:inset 0 0 0 3px rgba(214,95,36,.75)}
.mg-connect-editor-step{position:absolute;left:4px;top:3px;font-size:clamp(.48rem,calc(.76rem - var(--connect-size,6)*.018rem),.7rem);font-weight:700;opacity:.55;z-index:6}
.mg-connect-editor-marker{position:absolute;z-index:8;display:grid;place-items:center;width:clamp(22px,calc(42px - var(--connect-size,6)*1.4px),36px);aspect-ratio:1/1;border-radius:999px;background:#172033;color:#fff;border:3px solid #fff;box-shadow:0 3px 9px rgba(0,0,0,.22);font-size:clamp(.74rem,calc(1.08rem - var(--connect-size,6)*.028rem),1rem)}
.mg-connect-editor-layer{position:absolute;inset:0;z-index:4;width:100%;height:100%;pointer-events:none}
.mg-connect-editor-line{fill:none;stroke:#2457d6;stroke-width:.14;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 .04px .08px rgba(0,0,0,.28))}
.mg-connect-editor-barrier{stroke:#d65f24;stroke-width:.2;stroke-linecap:round;filter:drop-shadow(0 .04px .05px rgba(0,0,0,.25))}
.mg-connect-editor-status{font-size:.95rem}.mg-connect-editor-status h2{margin-top:0}.mg-connect-editor-status ul{padding-left:1.2rem;margin:.5rem 0}body.mg-ui-mobile .mg-connect-editor-main{grid-template-columns:1fr}body.mg-ui-mobile .mg-connect-editor-board{width:min(100%,calc(100dvw - 32px))}.mg-puzzle-app-minimal .mg-preview-wrap{background:rgba(8,13,24,.72);border-radius:26px}.mg-puzzle-start{border-radius:999px;font-weight:900;padding:13px 24px;box-shadow:0 16px 35px rgba(36,87,214,.35)}.mg-puzzle-complete p{margin:0}.mg-connect-board{background:#fff;border-color:rgba(16,24,39,.08)}.mg-connect-cell{border-color:rgba(16,24,39,.055)}.mg-connect-marker{background:#172033}.mg-tile{border-radius:clamp(8px,1.2vmin,16px)}.mg-memory-pair-editor{display:grid;gap:10px}.mg-memory-pair-editor h2{font-size:1.1rem;margin:.5rem 0 0}.mg-memory-pair-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.mg-memory-app{display:grid;gap:12px;width:min(100%,860px);margin-inline:auto;margin-top:8px}.mg-memory-stage{position:relative;display:grid;place-items:center;min-height:min(78dvh,780px);width:100%;max-width:100%;overflow:hidden;padding:clamp(8px,2vw,18px)}.mg-memory-preview{position:absolute;inset:clamp(8px,2vw,18px);z-index:3;display:none;place-items:center;align-content:center;gap:18px;backdrop-filter:blur(8px);text-align:center}.mg-memory-preview.show{display:grid}.mg-memory-preview-icon{display:grid;place-items:center;width:94px;height:94px;border-radius:28px;background:rgba(255,255,255,.12);font-size:3rem}.mg-memory-board{width:min(100%,calc(100dvw - 48px),calc(100dvh - 190px),760px);display:grid;gap:clamp(6px,1vmin,12px);align-self:center}.mg-memory-card{position:relative;display:grid;place-items:center;aspect-ratio:1/1;min-width:0;padding:0;border:0;border-radius:clamp(10px,1.5vmin,18px);overflow:hidden;background:#26324a;color:white;font-size:clamp(1.4rem,4vmin,2.5rem);font-weight:950;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16),0 10px 24px rgba(0,0,0,.22);background-size:cover;background-position:center}.mg-memory-card img{width:100%;height:100%;object-fit:cover}.mg-memory-card.is-open{background:#fff}.mg-memory-card.is-found{box-shadow:inset 0 0 0 4px rgba(34,197,94,.75),0 10px 24px rgba(0,0,0,.18)}.mg-memory-card.is-closed:hover{transform:translateY(-1px)}body.mg-ui-mobile .mg-memory-board{width:min(100%,calc(100dvw - 36px));gap:6px}body.mg-ui-mobile .mg-memory-pair-grid{grid-template-columns:1fr}
.mg-sudoku-app{display:grid;gap:12px;width:min(100%,900px);margin-inline:auto;margin-top:8px}.mg-sudoku-stage{position:relative;display:grid;place-items:center;min-height:min(82dvh,860px);width:100%;max-width:100%;overflow:hidden;padding:clamp(8px,2vw,18px)}.mg-sudoku-preview{position:absolute;inset:clamp(8px,2vw,18px);z-index:5;display:none;place-items:center;align-content:center;gap:18px;backdrop-filter:blur(8px);text-align:center}.mg-sudoku-preview.show{display:grid}.mg-sudoku-preview-icon{display:grid;place-items:center;width:94px;height:94px;border-radius:28px;background:rgba(255,255,255,.12);font-size:3rem}.mg-sudoku-play-area{display:grid;gap:14px;justify-items:center;width:100%}.mg-sudoku-board{display:grid;width:min(100%,calc(100dvw - 44px),calc(100dvh - 250px),680px);aspect-ratio:1/1;background:#f8fafc;border:4px solid #101827;border-radius:18px;overflow:hidden;box-shadow:0 16px 45px rgba(0,0,0,.26)}.mg-sudoku-cell{display:grid;place-items:center;min-width:0;min-height:0;padding:clamp(3px,.7vmin,8px);border:0;border-right:1px solid rgba(16,24,39,.16);border-bottom:1px solid rgba(16,24,39,.16);background:#fff;cursor:pointer}.mg-sudoku-cell img{width:88%;height:88%;object-fit:cover;border-radius:clamp(6px,1vmin,13px);box-shadow:0 2px 8px rgba(16,24,39,.14)}.mg-sudoku-cell.is-fixed{background:#e8edf7;cursor:default}.mg-sudoku-cell.is-fixed img{filter:saturate(.95);box-shadow:0 0 0 2px rgba(16,24,39,.12),0 2px 8px rgba(16,24,39,.12)}.mg-sudoku-cell.is-empty::before{content:"";width:28%;aspect-ratio:1;border-radius:999px;background:rgba(36,87,214,.12)}.mg-sudoku-cell.has-conflict{background:#fee2e2;box-shadow:inset 0 0 0 3px rgba(220,38,38,.45)}.mg-sudoku-cell.box-edge-right{border-right:4px solid #101827}.mg-sudoku-cell.box-edge-bottom{border-bottom:4px solid #101827}.mg-sudoku-palette{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;width:min(100%,720px);padding:10px;border-radius:20px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.14)}.mg-sudoku-symbol-button,.mg-sudoku-clear-button{display:grid;place-items:center;width:clamp(42px,7vw,58px);height:clamp(42px,7vw,58px);padding:5px;border-radius:16px;background:#fff;color:#101827;border:3px solid transparent;box-shadow:0 8px 18px rgba(0,0,0,.16)}.mg-sudoku-symbol-button img{width:100%;height:100%;object-fit:cover;border-radius:11px}.mg-sudoku-symbol-button.is-active,.mg-sudoku-clear-button.is-active{border-color:#facc15;transform:translateY(-1px)}.mg-sudoku-status{min-height:24px;margin:0;font-weight:800;text-align:center}.mg-sudoku-symbol-editor{display:grid;gap:10px}.mg-sudoku-symbol-editor h2{font-size:1.1rem;margin:.5rem 0 0}.mg-sudoku-symbol-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.mg-sudoku-editor-card{max-width:1180px}body.mg-ui-mobile .mg-sudoku-board{width:min(100%,calc(100dvw - 36px));border-width:3px;border-radius:14px}body.mg-ui-mobile .mg-sudoku-cell.box-edge-right{border-right-width:3px}body.mg-ui-mobile .mg-sudoku-cell.box-edge-bottom{border-bottom-width:3px}body.mg-ui-mobile .mg-sudoku-symbol-grid{grid-template-columns:1fr}
.mg-quiz-app .mg-quiz-stage,.mg-quiz-stage {
    width: min(980px, 100%);
    margin: 0 auto;
}
.mg-quiz-preview {
    min-height: 52vh;
    display: grid;
    place-items: center;
    gap: 1rem;
    text-align: center;
}
.mg-quiz-play-area[hidden] {
    display: none !important;
}
.mg-quiz-preview[hidden] {
    display: none !important;
}
.mg-quiz-preview-icon {
    width: 6rem;
    height: 6rem;
    border-radius: 2rem;
    display: grid;
    place-items: center;
    font-size: 4rem;
    font-weight: 900;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
}
.mg-quiz-meta,.mg-quiz-status {
    margin: .75rem 0;
    opacity: .82;
    font-size: .95rem;
}
.mg-quiz-questions {
    display: grid;
    gap: 1rem;
}
.mg-quiz-question-card {
    padding: 1rem;
}
.mg-quiz-question-card h2 {
    margin: 0 0 .35rem;
    font-size: clamp(1rem, 2vw, 1.25rem);
}
.mg-quiz-question-meta {
    margin-bottom: .75rem;
    opacity: .7;
    font-size: .9rem;
}
.mg-quiz-choices {
    display: grid;
    gap: .55rem;
}
.mg-quiz-choice {
    display: flex;
    gap: .65rem;
    align-items: center;
    padding: .8rem .9rem;
    border-radius: .9rem;
    background: rgba(0,0,0,.16);
    border: 1px solid rgba(255,255,255,.13);
    cursor: pointer;
}
.mg-quiz-choice:hover,
.mg-quiz-choice:has(input:checked) {
    background: rgba(255,255,255,.16);
}
.mg-quiz-choice input {
    min-width: 1.1rem;
    min-height: 1.1rem;
}
.mg-quiz-choice-admin {
    display: grid;
    grid-template-columns: minmax(5rem, auto) 1fr auto;
    gap: .6rem;
    align-items: center;
}
    body.mg-ui-mobile .mg-quiz-choice-admin{
        grid-template-columns: 1fr;
    }
.mg-tower-swap-stage {
    min-height: min(72vh, 760px);
    display: grid;
    place-items: center;
    padding: clamp(0.85rem, 2vw, 1.6rem);
    position: relative;
    overflow: hidden;
}
.mg-tower-swap-play {
    width: min(100%, 1024px);
    display: grid;
    gap: 1rem;
}

.mg-tower-swap-preview {
    width: min(100%, 1024px);
    padding: clamp(1rem, 2vw, 1.5rem);
    gap: 1rem;
}
.mg-tower-swap-preview > #mgTowerSwapPreviewText {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 900;
}
.mg-tower-swap-preview-meta {
    margin: 0;
    font-weight: 700;
}
.mg-tower-swap-preview-hint {
    margin: 0;
    max-width: 56rem;
    color: rgba(248,250,252,.96);
    font-weight: 700;
}
.mg-tower-swap-preview-boards {
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.mg-tower-swap-preview-panel {
    display: grid;
    gap: .75rem;
    padding: .9rem;
}
.mg-tower-swap-preview-title {
    margin: 0;
    text-align: center;
    font-size: .92rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: rgba(226,232,240,.88);
}
.mg-tower-swap-preview-board {
    display: grid;
    grid-template-columns: repeat(var(--tower-peg-count, 3), minmax(0, 1fr));
    gap: .5rem;
    align-items: stretch;
}
.mg-tower-swap-peg-preview {
    min-height: clamp(9.5rem, 20vh, 12rem);
    padding: 1.7rem .45rem 1.3rem;
}
.mg-tower-swap-peg-target-preview {
    border-color: rgba(147,197,253,.38);
    background:
        linear-gradient(180deg, rgba(147,197,253,.12), rgba(255,255,255,.03)),
        linear-gradient(180deg, rgba(2,6,23,.35), rgba(2,6,23,.18));
}
.mg-tower-swap-preview .mg-tower-swap-peg-label {
    width: 1.75rem;
    height: 1.75rem;
    top: .65rem;
    font-size: .82rem;
}
.mg-tower-swap-preview .mg-tower-swap-stack {
    left: .4rem;
    right: .4rem;
    bottom: 1.3rem;
}
.mg-tower-swap-preview .mg-tower-swap-disk {
    height: 1.35rem;
    font-size: .56rem;
    padding: 0 .35rem;
}
.mg-tower-swap-help {
    text-align: center;
    margin: 0;
    color: rgba(248,250,252,.9);
    font-weight: 800;
    background: rgba(15,23,42,.58);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    padding: .7rem 1rem;
}
.mg-tower-swap-help.is-error {
    color: #fee2e2;
    background: rgba(127,29,29,.45);
    border-color: rgba(252,165,165,.45);
    animation: mgTowerSwapShake 380ms ease;
}
.mg-tower-swap-panel {
    display: grid;
    gap: .85rem;
    padding: .95rem;
}
.mg-tower-swap-panel-target {
    background: rgba(30,41,59,.55);
}
.mg-tower-swap-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
}
.mg-tower-swap-panel-title {
    margin: 0;
    font-size: .95rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: rgba(226,232,240,.88);
}
.mg-tower-swap-target,
.mg-tower-swap-board {
    display: grid;
    grid-template-columns: repeat(var(--tower-peg-count, 3), minmax(0, 1fr));
    gap: clamp(.55rem, 1.6vw, 1rem);
    align-items: stretch;
}
.mg-tower-swap-target {
    opacity: .9;
}
.mg-tower-swap-peg {
    position: relative;
    display: block;
    min-height: clamp(15rem, 42vh, 25rem);
    padding: 2rem .6rem 1.6rem;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 1.35rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)),
        linear-gradient(180deg, rgba(2,6,23,.35), rgba(2,6,23,.18));
    color: white;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
button.mg-tower-swap-peg {
    cursor: pointer;
}
button.mg-tower-swap-peg:hover,
button.mg-tower-swap-peg:focus-visible,
.mg-tower-swap-peg.is-selected {
    outline: none;
    border-color: rgba(147,197,253,.7);
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 2px rgba(147,197,253,.5), 0 14px 30px rgba(0,0,0,.28);
}
.mg-tower-swap-peg-target {
    min-height: clamp(10rem, 20vh, 13rem);
    pointer-events: none;
}
.mg-tower-swap-peg::before {
    content: "";
    position: absolute;
    left: .8rem;
    right: .8rem;
    bottom: .95rem;
    height: .95rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #b45309, #78350f);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 .35rem 1rem rgba(0,0,0,.25);
}
.mg-tower-swap-pole {
    position: absolute;
    left: 50%;
    bottom: 1.65rem;
    width: .7rem;
    height: calc(100% - 3.4rem);
    border-radius: 999px 999px .25rem .25rem;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #d6b98a 0%, #9a6a31 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 .2rem .5rem rgba(0,0,0,.25);
    z-index: 1;
}
.mg-tower-swap-peg-label {
    position: absolute;
    left: 50%;
    top: .8rem;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(15,23,42,.72);
    border: 1px solid rgba(255,255,255,.14);
    color: #f8fafc;
    font-weight: 950;
    font-size: .9rem;
    z-index: 3;
}
.mg-tower-swap-stack {
    position: absolute;
    left: .6rem;
    right: .6rem;
    bottom: 1.55rem;
    z-index: 2;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: .32rem;
    min-height: 2rem;
}
.mg-tower-swap-disk {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.8rem;
    max-width: 100%;
    height: clamp(1.55rem, 3.1vh, 2rem);
    padding: 0 .55rem;
    border-radius: .95rem;
    color: rgba(255,255,255,.96);
    font-size: clamp(.58rem, 1.1vw, .8rem);
    font-weight: 900;
    line-height: 1;
    text-align: center;
    letter-spacing: .01em;
    text-shadow: 0 1px 2px rgba(0,0,0,.42);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.25),
        inset 0 -2px 0 rgba(0,0,0,.12),
        0 .45rem .85rem rgba(0,0,0,.24);
    border: 1px solid rgba(255,255,255,.24);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mg-tower-swap-disk-target {
    opacity: .92;
}
.mg-tower-swap-json-editor {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.mg-tower-swap-json-editor textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
}
    body.mg-ui-mobile .mg-tower-swap-play{
        gap: .8rem;
    }
    body.mg-ui-mobile .mg-tower-swap-preview{
        gap: .85rem;
    }
    body.mg-ui-mobile .mg-tower-swap-preview-boards{
        grid-template-columns: 1fr;
        gap: .75rem;
    }
    body.mg-ui-mobile .mg-tower-swap-peg-preview{
        min-height: 8.8rem;
    }
    body.mg-ui-mobile .mg-tower-swap-panel{
        padding: .75rem;
    }
    body.mg-ui-mobile .mg-tower-swap-target,body.mg-ui-mobile .mg-tower-swap-board{
        gap: .4rem;
    }
    body.mg-ui-mobile .mg-tower-swap-peg{
        min-height: 13.5rem;
        padding-inline: .35rem;
        border-radius: 1rem;
    }
    body.mg-ui-mobile .mg-tower-swap-peg-target{
        min-height: 9rem;
    }
    body.mg-ui-mobile .mg-tower-swap-peg::before{
        left: .45rem;
        right: .45rem;
    }
    body.mg-ui-mobile .mg-tower-swap-stack{
        left: .35rem;
        right: .35rem;
    }
    body.mg-ui-mobile .mg-tower-swap-disk{
        min-width: 2rem;
        font-size: .52rem;
        padding: 0 .3rem;
    }
.mg-goalkeeper-stage{position:relative;display:grid;place-items:center;min-height:560px;margin-top:14px;padding:18px;overflow:hidden}.mg-goalkeeper-preview{display:grid;place-items:center;gap:12px;max-width:620px;text-align:center;padding:30px}.mg-goalkeeper-preview h2,.mg-goalkeeper-preview p{margin:0}.mg-goalkeeper-preview-icon{font-size:4rem}.mg-goalkeeper-preview-stats{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}.mg-goalkeeper-preview-stats span{padding:8px 13px;font-weight:900}.mg-goalkeeper-play{display:grid;justify-items:center;width:100%;max-width:100%}.mg-goalkeeper-canvas{display:block;width:var(--mg-goalkeeper-field-width,min(100%,560px));height:var(--mg-goalkeeper-field-height,auto);max-width:100%;touch-action:none;border-radius:22px;box-shadow:0 24px 70px rgba(0,0,0,.4);border:4px solid rgba(255,255,255,.7);background:#146c3b}.mg-goalkeeper-mobile-controls{display:flex;justify-content:center;gap:16px;margin-top:12px}.mg-goalkeeper-mobile-controls button{width:92px;height:52px;border:0;border-radius:999px;background:#fff;color:#172033;font-size:1.4rem;font-weight:950;box-shadow:0 8px 24px rgba(0,0,0,.24);touch-action:none}.mg-goalkeeper-app.is-playing .mg-mentor-card{display:none}.mg-goalkeeper-editor-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);gap:18px;align-items:start}.mg-goalkeeper-editor-preview{position:relative;width:100%;aspect-ratio:5/7;overflow:hidden}.mg-goalkeeper-preview-goal{position:absolute;left:25%;right:25%;bottom:2%;height:16%;border:3px solid rgba(255,255,255,.8);border-bottom:0}.mg-goalkeeper-preview-keeper{position:absolute;left:38%;width:24%;bottom:7.8%;height:2.4%;background:white;border:2px solid #172033}.mg-goalkeeper-preview-obstacle{position:absolute;border:2px solid rgba(15,23,42,.75);box-sizing:border-box}.mg-goalkeeper-preview-obstacle.is-solid{background:#475569}.mg-goalkeeper-preview-obstacle.is-destructible{background:#e0a82e}body.mg-ui-desktop .mg-goalkeeper-app.is-playing .mg-goalkeeper-stage{min-height:0;padding:10px}body.mg-ui-desktop .mg-goalkeeper-app.is-playing .mg-goalkeeper-mobile-controls{display:none}body.mg-ui-mobile .mg-goalkeeper-editor-grid{grid-template-columns:1fr}body.mg-ui-mobile .mg-goalkeeper-stage{min-height:480px;padding:10px}body.mg-ui-mobile .mg-goalkeeper-mobile-controls button{width:42%;height:58px}body.mg-ui-desktop .mg-goalkeeper-app.is-playing .mg-goalkeeper-canvas{width:auto!important;height:min(76vh,760px)!important;max-height:calc(100vh - var(--mg-header-height) - 145px);aspect-ratio:5/7}body.mg-ui-desktop .mg-goalkeeper-app.is-playing .mg-goalkeeper-play{max-height:calc(100vh - var(--mg-header-height) - 105px);overflow:hidden}
.mg-connect-board.is-protected-preview {
    pointer-events: none;
    filter: saturate(.35);
    background: linear-gradient(135deg, #eef2f7, #dbe4f0);
}
.mg-connect-board.is-protected-preview .mg-connect-placeholder-cell {
    opacity: .78;
}
.mg-connect-board.is-protected-preview .mg-connect-placeholder-marker {
    border: 0;
    background: rgba(71,85,105,.72);
    color: transparent;
    box-shadow: 0 0 16px rgba(30,41,59,.28);
    filter: blur(3px);
    transform: scale(.82);
}
.mg-tower-swap-placeholder-disk {
    min-height: 1rem;
    color: transparent !important;
    background: linear-gradient(90deg, #64748b, #94a3b8) !important;
    border-color: rgba(255,255,255,.18) !important;
}
.mg-play-shell[data-play-state="countdown"] .mg-puzzle-board,
.mg-play-shell[data-play-state="countdown"] [data-testid$="-board"]{user-select:none;}
.mg-puzzle-protected-preview{pointer-events:none;aspect-ratio:1/1;width:min(100%,34rem);filter:blur(7px) saturate(.7);transform:scale(.98);}
[data-equipment-policy] .mg-tile {
    transition-duration: var(--equipment-tile-transition-duration, 220ms);
}
[data-equipment-policy] .mg-connect-line {
    stroke-width: var(--equipment-connect-line-width, .16);
}
[data-equipment-policy] .mg-memory-card,
[data-equipment-policy] .mg-memory-tile {
    transition-duration: var(--equipment-memory-transition-duration, 220ms);
}
[data-equipment-policy] .mg-sudoku-cell.has-conflict {
    box-shadow: inset 0 0 0 var(--equipment-conflict-outline-width, 3px) rgba(220,38,38,.55);
}
[data-equipment-policy] .mg-quiz-choice:focus-within,
[data-equipment-policy] .mg-quiz-choice:has(input:checked) {
    outline: var(--equipment-answer-focus-width, 2px) solid rgba(250,204,21,.68);
    outline-offset: 2px;
}
[data-equipment-policy] .mg-tower-swap-peg {
    transition-duration: var(--equipment-selection-transition-duration, 180ms);
}.mg-lineup-pitch{position:relative;min-height:520px;aspect-ratio:2/3;border-radius:22px;overflow:hidden;background:linear-gradient(180deg,#167847,#0f6a3e);border:2px solid rgba(255,255,255,.75);box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}.mg-lineup-pitch:before{content:"";position:absolute;inset:10px;border:2px solid rgba(255,255,255,.52);border-radius:18px}body.mg-ui-mobile .mg-lineup-pitch{min-height:430px;aspect-ratio:10/13}
.mg-tactics-page .mg-lineup-pitch{width:min(100%,560px);min-height:640px;margin:0 auto;border:0;border-radius:0;background:radial-gradient(circle at center,rgba(47,185,98,.38),transparent 38%),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(180deg,#148a4e,#0f7a47 52%,#0c6a3e);background-size:auto,25% 100%,auto;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16),inset 0 0 80px rgba(0,0,0,.28)}.mg-tactics-page .mg-lineup-pitch:before{inset:16px;border:1px solid rgba(255,255,255,.42);border-radius:0}body.mg-ui-mobile .mg-tactics-page .mg-lineup-pitch{min-height:560px}body.mg-ui-mobile .mg-tactics-page .mg-lineup-pitch{min-height:500px;width:min(100%,440px)}body.mg-ui-mobile .mg-tactics-page .mg-lineup-pitch{min-height:430px}.mg-lineup-v2-page .mg-lineup-pitch{width:100%;min-height:585px;border-radius:10px;background:radial-gradient(circle at center,color-mix(in srgb,var(--color-action-primary) 13%,transparent),transparent 35%),repeating-linear-gradient(90deg,rgb(255 255 255/.035) 0 12.5%,transparent 12.5% 25%),linear-gradient(180deg,color-mix(in srgb,var(--color-action-primary) 68%,var(--color-success)),color-mix(in srgb,var(--color-action-primary) 78%,var(--color-action-primary-hover)) 52%,color-mix(in srgb,var(--color-action-primary) 58%,var(--color-action-primary-hover)));box-shadow:inset 0 0 0 1px rgb(255 255 255/.23),inset 0 0 58px rgb(0 0 0/.23)}.mg-lineup-v2-page .mg-lineup-pitch:before{inset:13px;border-color:rgb(255 255 255/.45)}
.mg-formation-item-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.mg-formation-item{position:relative;display:grid;justify-items:center;gap:4px;min-height:101px;padding:7px;border:1px solid var(--mg-lineup-border);border-radius:9px;background:var(--mg-lineup-surface-soft);color:var(--mg-lineup-text-secondary);cursor:pointer}.mg-formation-item input{position:absolute;opacity:0;pointer-events:none}.mg-formation-item strong{font-size:.7rem}.mg-formation-item small{font-size:.54rem;color:var(--mg-lineup-muted)}.mg-formation-item.is-active{border-color:var(--mg-lineup-accent);box-shadow:inset 0 0 0 2px var(--mg-lineup-accent);background:var(--mg-lineup-surface-subtle);color:var(--mg-lineup-text)}.mg-formation-item.is-active .mg-item-glyph--formation{color:var(--mg-lineup-text)}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:540px}body.mg-ui-mobile .mg-formation-item-grid{grid-template-columns:repeat(5,minmax(88px,1fr));overflow:auto}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:480px}body.mg-ui-mobile .mg-formation-item-grid{grid-template-columns:repeat(3,minmax(88px,1fr))}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:430px}
.mg-lineup-v2-page .mg-lineup-pitch{
  position:relative;
  aspect-ratio:9/15;
  min-height:660px;
  overflow:hidden;
  background-image:
    radial-gradient(circle at center,rgb(255 255 255/.08),transparent 38%),
    linear-gradient(to right,rgb(255 255 255/.17) 1px,transparent 1px),
    linear-gradient(to bottom,rgb(255 255 255/.17) 1px,transparent 1px),
    linear-gradient(180deg,color-mix(in srgb,var(--color-action-primary) 68%,var(--color-success)),color-mix(in srgb,var(--color-action-primary) 78%,var(--color-action-primary-hover)) 52%,color-mix(in srgb,var(--color-action-primary) 58%,var(--color-action-primary-hover)));
  background-size:auto,var(--lineup-cell-width,11.111111%) 100%,100% var(--lineup-cell-height,6.666667%),auto;
  background-position:center,0 0,0 0,center;
  border:1px solid color-mix(in srgb,var(--color-border) 70%,transparent);
  border-radius:10px;
  box-shadow:inset 0 0 0 1px rgb(255 255 255/.2),inset 0 0 58px rgb(0 0 0/.23);
}
.mg-lineup-v2-page .mg-lineup-pitch:before{
  content:"";
  position:absolute;
  inset:calc(var(--lineup-cell-height,6.666667%) * 2) var(--lineup-cell-width,11.111111%);
  border:2px solid rgb(255 255 255/.5);
  border-radius:0;
  pointer-events:none;
}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:600px}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:520px}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:470px}

.mg-lineup-v2-page .mg-lineup-pitch{
  position:relative;
  width:100%;
  aspect-ratio:2/3;
  min-height:0;
  overflow:hidden;
  isolation:isolate;
  border:0;
  border-radius:12px;
  background:none;
  box-shadow:0 12px 30px rgb(11 24 10/.22);
}
.mg-lineup-v2-page .mg-lineup-pitch:before{content:none!important}
  body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:0}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-lineup-pitch{border:4px solid var(--bso-bg)!important;border-radius:14px!important;box-shadow:inset 0 0 0 2px var(--bso-border-strong),0 4px 0 #000!important}
body.mg-theme-bso.mg-is-minigame :is(.mg-play-shell,.mg-puzzle-stage,.mg-goalkeeper-stage,.mg-heatmap-stage,.mg-memory-stage,.mg-quiz-stage,.mg-sudoku-stage,.mg-symbol-hunt-stage,.mg-tower-swap-stage,.mg-connect-stage){border:4px solid var(--bso-bg);border-radius:14px;background:linear-gradient(var(--bso-panel),var(--bso-shell));box-shadow:inset 0 0 0 2px var(--bso-border-soft),0 5px 0 #000;color:var(--bso-text)}
body.mg-theme-bso.mg-is-minigame :is(.mg-game-hud,.mg-play-topbar,.mg-puzzle-topbar){border:4px solid var(--bso-bg);border-radius:12px;background:linear-gradient(var(--bso-blue-mid),var(--bso-blue-deep));box-shadow:inset 0 2px rgb(255 255 255/.12),0 3px 0 #000;color:var(--bso-text)}
body.mg-theme-bso.mg-is-minigame :is(.mg-puzzle-start,.mg-primary-wide){border:3px solid var(--bso-bg)!important;background:var(--bso-gradient-success)!important;color:var(--bso-text)!important;box-shadow:0 3px 0 #000!important}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-lineup-v2-page .mg-lineup-pitch{
  border:4px solid var(--bso-bg)!important;
  border-radius:12px!important;
  background:
    linear-gradient(to bottom,transparent 49.7%,color-mix(in srgb,var(--bso-success-light) 48%,transparent) 49.8% 50.2%,transparent 50.3%),
    radial-gradient(circle at 50% 50%,transparent 0 10.5%,color-mix(in srgb,var(--bso-success-light) 48%,transparent) 10.8% 11.4%,transparent 11.7%),
    repeating-linear-gradient(90deg,rgb(255 255 255/.025) 0 10%,rgb(0 0 0/.035) 10% 20%),
    linear-gradient(180deg,var(--bso-success-dark),var(--bso-success-deep) 52%,color-mix(in srgb,var(--bso-success-deep) 74%,var(--bso-bg)))!important;
  box-shadow:inset 0 0 0 2px var(--bso-border-strong),inset 0 0 48px rgb(0 0 0/.42),0 5px 0 #000!important;
}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-lineup-v2-page .mg-lineup-pitch::before{
  content:""!important;
  position:absolute;
  inset:5.5% 8%;
  z-index:1;
  display:block!important;
  border:2px solid color-mix(in srgb,var(--bso-success-light) 48%,transparent)!important;
  border-radius:2px;
  pointer-events:none;
}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) :is(.mg-formation-item,.mg-template-card,.mg-inventory-item,.mg-lineup-bench-slot>button[data-slot-target]){border-color:var(--bso-bg)!important;background:linear-gradient(var(--bso-panel-raised),var(--bso-panel))!important;color:var(--bso-text-secondary)!important;box-shadow:inset 0 0 0 1px var(--bso-border-strong)!important}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) :is(.mg-formation-item.is-active,.mg-lineup-inventory-tabs button.is-active){border-color:var(--bso-bg)!important;background:linear-gradient(var(--bso-blue-mid),var(--bso-blue-deep))!important;color:var(--bso-text)!important;box-shadow:inset 0 0 0 1px var(--bso-blue-light),0 2px 0 #000!important}
body.mg-theme-bso.mg-is-minigame .mg-goalkeeper-mobile-controls button{
  border:3px solid var(--bso-bg);
  border-radius:10px;
  background:linear-gradient(var(--bso-blue-mid),var(--bso-blue-deep));
  box-shadow:inset 0 2px rgb(255 255 255/.13),0 3px 0 #000;
  color:var(--bso-text);
  text-shadow:0 1px 0 #000;
}
body.mg-theme-bso.mg-is-minigame .mg-sudoku-palette{border:3px solid var(--bso-bg);background:var(--bso-shell);box-shadow:inset 0 0 0 1px var(--bso-border-strong)}
body.mg-theme-bso.mg-is-minigame :is(.mg-sudoku-symbol-button,.mg-sudoku-clear-button){border:3px solid var(--bso-bg);background:linear-gradient(var(--bso-border-soft),var(--bso-panel));box-shadow:inset 0 1px rgb(255 255 255/.08),0 3px 0 #000;color:var(--bso-text)}
body.mg-theme-bso.mg-is-minigame :is(.mg-sudoku-symbol-button,.mg-sudoku-clear-button).is-active{border-color:var(--bso-gold-light);box-shadow:0 0 0 2px var(--bso-bg),0 0 0 5px var(--bso-gold-light),0 3px 0 #000}
body.mg-theme-bso.mg-is-minigame .mg-memory-card{border:3px solid var(--bso-bg);box-shadow:inset 0 0 0 1px var(--bso-border-strong),0 5px 0 #000}
body.mg-theme-bso.mg-is-minigame .mg-memory-card.is-open{background:var(--bso-text-secondary)}
body.mg-theme-bso.mg-is-minigame :is(.mg-quiz-choice,.mg-symbol-hunt-card,.mg-tower-swap-panel){border-color:var(--bso-bg);box-shadow:inset 0 0 0 1px var(--bso-border-strong),0 3px 0 #000}
.mg-replay-toolbar { display:flex; gap:.75rem; align-items:center; flex-wrap:wrap; margin:1rem 0; }
.mg-replay-toolbar label { display:flex; gap:.4rem; align-items:center; }
.mg-replay-toolbar select { min-width:5rem; }
.mg-replay-toolbar [data-replay-status] { opacity:.78; }
.mg-replay-stage { display:flex; justify-content:center; width:100%; overflow:visible; }
.mg-replay-pitch {
    position:relative; width:min(100%, 620px); aspect-ratio:7 / 13; overflow:visible;
    border:2px solid rgba(255,255,255,.82); border-radius:1.2rem;
    background:
        linear-gradient(to right, rgba(255,255,255,.14) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.14) 1px, transparent 1px),
        linear-gradient(180deg, rgba(39,128,66,.96), rgba(25,104,51,.98));
    background-size:calc(100% / 7) 100%, 100% calc(100% / 13), 100% 100%;
    box-shadow:inset 0 0 0 1px rgba(0,0,0,.16), 0 18px 40px rgba(0,0,0,.16);
}
.mg-replay-halfway { position:absolute; left:0; right:0; top:50%; border-top:2px solid rgba(255,255,255,.75); }
.mg-replay-center-circle { position:absolute; left:50%; top:50%; width:22%; aspect-ratio:1; border:2px solid rgba(255,255,255,.75); border-radius:50%; transform:translate(-50%,-50%); }
.mg-replay-box { position:absolute; left:calc(100% / 7); width:calc(500% / 7); height:calc(300% / 13); border:2px solid rgba(255,255,255,.75); }
.mg-replay-box-top { top:0; border-top:0; }
.mg-replay-box-bottom { bottom:0; border-bottom:0; }
.mg-replay-goal { position:absolute; left:calc(200% / 7); width:calc(300% / 7); height:1.4%; border:2px solid rgba(255,255,255,.85); }
.mg-replay-goal-top { top:-1.4%; border-bottom:0; }
.mg-replay-goal-bottom { bottom:-1.4%; border-top:0; }
.mg-replay-player { position:absolute; z-index:20; width:clamp(30px, 7vw, 48px); aspect-ratio:1; transform:translate(-50%,-50%) translate(var(--fan-x,0),var(--fan-y,0)); transition:none; }
.mg-replay-player img,.mg-replay-player-fallback { width:100%; height:100%; display:grid; place-items:center; object-fit:cover; border-radius:50%; background:var(--bso-panel); box-shadow:0 2px 8px rgba(0,0,0,.4); border:3px solid currentColor; }
.mg-replay-player.is-home { color:#5182e7; }
.mg-replay-player.is-away { color:#ffc934; }
.mg-replay-facing { --face-x:0; --face-y:-1; position:absolute; left:50%; top:50%; width:7px; height:7px; border-radius:50%; background:currentColor; transform:translate(calc(-50% + var(--face-x) * 27px), calc(-50% + var(--face-y) * 27px)); box-shadow:0 0 0 2px rgba(0,0,0,.28); }
.mg-replay-ball { position:absolute; z-index:30; width:12px; height:12px; border-radius:50%; background:#fff; border:2px solid #101820; transform:translate(-50%,-50%); box-shadow:0 2px 4px rgba(0,0,0,.5); pointer-events:none; }
.mg-replay-ball[data-height="medium"] { transform:translate(-50%,-65%) scale(1.08); box-shadow:0 5px 5px rgba(0,0,0,.34); }
.mg-replay-ball[data-height="high"] { transform:translate(-50%,-85%) scale(1.16); box-shadow:0 9px 7px rgba(0,0,0,.28); }
.mg-replay-ball[data-height="very_high"] { transform:translate(-50%,-115%) scale(1.24); box-shadow:0 14px 9px rgba(0,0,0,.22); }
.mg-replay-timeline { width:100%; margin:1rem 0 .5rem; }
.mg-replay-scoreline { display:grid; grid-template-columns:1fr auto 1fr; gap:1rem; align-items:center; text-align:center; }
.mg-replay-scoreline strong:first-child { text-align:right; }
.mg-replay-scoreline strong:last-child { text-align:left; }
    body.mg-ui-mobile .mg-replay-stage{ overflow-x:auto; padding:.25rem 0; }
    body.mg-ui-mobile .mg-replay-pitch{ width:min(92vw, 470px); flex:0 0 auto; }
    body.mg-ui-mobile .mg-replay-player{ width:34px; }
    body.mg-ui-mobile .mg-replay-facing{ transform:translate(calc(-50% + var(--face-x) * 21px), calc(-50% + var(--face-y) * 21px)); }
.mg-lineup-v2-page .mg-lineup-pitch{aspect-ratio:15/23!important}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-lineup-v2-page .mg-lineup-pitch{background:linear-gradient(180deg,var(--bso-blue-deep),var(--bso-blue-dark) 55%,var(--bso-blue-deep))!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bso-gold-light) 22%,transparent),inset 0 0 90px rgb(0 0 0/.45),0 12px 28px rgb(0 0 0/.25)!important}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:520px}body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{min-height:460px}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-formation-item,
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-tactic-item-slot{
  border:3px solid var(--bso-bg)!important;
  background:var(--bso-gradient-panel)!important;
  color:var(--bso-text-secondary)!important;
  box-shadow:inset 0 0 0 1px var(--bso-border-strong),0 3px 0 var(--bso-bg)!important;
}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-tactic-item-slot.is-filled,
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-formation-item.is-active{
  border-style:solid!important;
  border-color:var(--bso-bg)!important;
  background:var(--bso-gradient-blue)!important;
  color:var(--bso-text)!important;
  box-shadow:inset 0 0 0 1px var(--bso-blue-light),0 3px 0 var(--bso-bg)!important;
}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-tactic-item-slot .mg-item-glyph,
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-formation-item.is-active .mg-item-glyph,
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-selected-item-icon .mg-item-glyph{
  color:var(--bso-gold-light)!important;
}
body.mg-theme-bso:not(.mg-shell-manager):not(.mg-is-minigame) .mg-formation-item:not(.is-active) .mg-item-glyph{
  color:var(--bso-text-secondary)!important;
}.mg-formation-item .mg-item-detail-trigger{margin-top:2px}.mg-youth-lineup-editor .mg-lineup-pitch{position:relative;width:100%;aspect-ratio:15/23!important;min-height:0;margin:0 auto;overflow:visible;border:0!important;border-radius:10px;background:var(--bso-blue-deep)!important;box-shadow:var(--bso-shadow)}.mg-youth-lineup-editor .mg-lineup-pitch:before{display:none}
.mg-replay-stage{position:relative;}
.mg-replay-special-popup{position:absolute;z-index:60;top:.75rem;left:50%;transform:translateX(-50%);width:min(94%,520px);padding:.7rem;border:1px solid rgba(255,255,255,.22);border-radius:14px;background:rgba(9,18,35,.94);box-shadow:0 12px 30px rgba(0,0,0,.34);backdrop-filter:blur(8px);color:#fff;pointer-events:none;}
.mg-replay-special-title{font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;opacity:.72;margin-bottom:.4rem;}
.mg-replay-special-rows{display:grid;gap:.35rem;}
.mg-replay-special-row{display:grid;grid-template-columns:36px minmax(88px,1fr) 32px minmax(110px,1.2fr) auto;align-items:center;gap:.45rem;min-height:42px;padding:.3rem .45rem;border-radius:10px;background:rgba(255,255,255,.07);}
.mg-replay-special-row.is-source{background:rgba(255,255,255,.12);}
.mg-replay-special-row.is-won{box-shadow:inset 3px 0 0 var(--color-success);}
.mg-replay-special-row.is-lost{opacity:.72;box-shadow:inset 3px 0 0 var(--color-danger);}
.mg-replay-special-face,.mg-replay-special-face img,.mg-replay-special-face-fallback{width:34px;height:34px;border-radius:50%;}
.mg-replay-special-face{display:grid;place-items:center;overflow:hidden;background:rgba(255,255,255,.1);}
.mg-replay-special-face img{object-fit:cover;}
.mg-replay-special-face-fallback{display:grid;place-items:center;font-weight:800;}
.mg-replay-special-player,.mg-replay-special-action{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.82rem;}
.mg-replay-special-player{font-weight:800;}
.mg-replay-special-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:rgba(255,255,255,.11);font-size:1.05rem;}
.mg-replay-special-outcome{font-size:.74rem;}
.mg-replay-special-row.is-won .mg-replay-special-outcome{color:var(--color-success);}
.mg-replay-special-row.is-lost .mg-replay-special-outcome{color:var(--color-danger);}
.mg-replay-special-result{display:block;margin-top:.5rem;text-align:center;font-size:.84rem;}
body.mg-ui-mobile .mg-replay-special-popup{top:.35rem;padding:.55rem}body.mg-ui-mobile .mg-replay-special-row{grid-template-columns:32px minmax(72px,1fr) 28px minmax(90px,1.1fr);gap:.3rem}body.mg-ui-mobile .mg-replay-special-outcome{grid-column:2/-1;text-align:right;margin-top:-.25rem}body.mg-ui-mobile .mg-replay-special-face,body.mg-ui-mobile .mg-replay-special-face img,body.mg-ui-mobile .mg-replay-special-face-fallback{width:30px;height:30px}
body.mg-theme-bso.mg-shell-manager:not(.mg-is-minigame) .mg-lineup-v2-page .mg-lineup-pitch{border-radius:12px;}
body.mg-theme-bso.mg-shell-manager:not(.mg-is-minigame) .mg-lineup-v2-page .mg-lineup-pitch::before{content:"";position:absolute;display:block;border-radius:2px;pointer-events:none;}
body.mg-theme-bso.mg-shell-manager:not(.mg-is-minigame) :is(.mg-formation-item,.mg-template-card,.mg-inventory-item,.mg-lineup-bench-slot>button[data-slot-target]){border:1px solid var(--bso-border-soft);background:var(--bso-surface-blue);background-image:none;box-shadow:none;color:var(--bso-white);}
body.mg-theme-bso.mg-shell-manager:not(.mg-is-minigame) :is(.mg-formation-item.is-active,.mg-lineup-inventory-tabs button.is-active){border:1px solid var(--bso-blue);background:var(--bso-gold);background-image:none;box-shadow:none;color:var(--bso-blue);}
body.mg-theme-bso.mg-shell-manager:not(.mg-is-minigame) :is(.mg-youth-positive,.mg-youth-status-ok,.mg-replay-special-row.is-won .mg-replay-special-outcome,.mg-public-club-form>b.is-s){color:var(--bso-white);}
.mg-lineup-v2-pitch .mg-lineup-pitch{max-height:62dvh;min-height:0;margin-inline:auto}
body.mg-ui-mobile .mg-lineup-v2-pitch .mg-lineup-pitch{max-height:56dvh}
.mg-stadium-planning form,.mg-pitch-care form{display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem;min-width:0}
.mg-stadium-planning form label,.mg-pitch-care form label{display:grid;gap:.35rem;min-width:0}
.mg-stadium-planning form input:not([type=hidden]),.mg-stadium-planning form select,.mg-pitch-care form select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.mg-stadium-planning form .mg-button,.mg-pitch-care form .mg-button{justify-self:start;max-width:100%;white-space:normal}
body.mg-ui-desktop .mg-youth-lineup-main .mg-lineup-pitch{max-width:700px}
body.mg-ui-mobile .mg-lineup-v2-page .mg-lineup-pitch{
  width:100%;
  min-height:0!important;
  aspect-ratio:13/19;
  overflow:hidden;
}body.mg-ui-mobile .mg-youth-lineup-main .mg-lineup-pitch{width:100%;max-width:430px}