:root {
    --v129-gold: #dfbd68;
    --v129-gold-light: #ffe8a5;
    --v129-ink: #030506;
    --v129-panel: rgba(8, 8, 8, .975);
    --v129-speaker: #dfbd68;
    --v129-speaker-glow: rgba(223, 189, 104, .48);
}

/* The legacy lesson engine remains off-screen; the real match DOM is the visible board. */
body.v129-tutorial-live {
    height: var(--v128-app-height, 100dvh) !important;
    min-height: 0 !important;
    max-height: var(--v128-app-height, 100dvh) !important;
    padding-top: calc(45px + env(safe-area-inset-top)) !important;
    overflow: hidden !important;
}

/* h2 is replaced by the fixed training topbar, so compact the real match grid
   from five rows to the four visible battle rows. */
body.v129-tutorial-live.v45-battle-active.v64-shocker-battle {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 4px !important;
}

body.v129-tutorial-live.v45-battle-active.v64-shocker-battle #turn-info {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

body.v129-tutorial-live.v45-battle-active.v64-shocker-battle #phase-bar {
    grid-column: 1 !important;
    grid-row: 2 !important;
}

body.v129-tutorial-live.v45-battle-active.v64-shocker-battle .opponent-area {
    grid-column: 1 !important;
    grid-row: 3 !important;
}

body.v129-tutorial-live.v45-battle-active.v64-shocker-battle .player-area {
    grid-column: 1 !important;
    grid-row: 4 !important;
}

body.v129-tutorial-live #revolution-status {
    position: fixed !important;
    left: 50% !important;
    top: max(103px, calc(env(safe-area-inset-top) + 91px)) !important;
    z-index: 630 !important;
    width: min(520px, calc(100vw - 22px)) !important;
    margin: 0 !important;
    transform: translateX(-50%);
    pointer-events: none !important;
}

body.v129-tutorial-live > h2 {
    display: none !important;
}

body.v129-tutorial-live #v45-battle-menu-button,
body.v129-tutorial-live #v56-chain-log-open,
body.v129-tutorial-live #character-ability-overlay,
body.v129-tutorial-live #v37-ability-choice,
body.v129-tutorial-live #counter-menu,
body.v129-tutorial-live #player-chain-menu {
    display: none !important;
}

#v122-onboarding.v129-live-field {
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    isolation: auto !important;
}

#v122-onboarding.v129-live-field::before,
#v122-onboarding.v129-live-field::after {
    content: none !important;
    display: none !important;
}

#v122-onboarding.v129-live-field .v122-stage {
    display: none !important;
}

#v122-onboarding.v129-live-field .v122-topbar {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    z-index: 2147483505 !important;
    min-height: calc(42px + env(safe-area-inset-top)) !important;
    height: calc(42px + env(safe-area-inset-top)) !important;
    padding: calc(4px + env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) 4px max(9px, env(safe-area-inset-left)) !important;
    pointer-events: auto !important;
    background: linear-gradient(90deg, rgba(1, 3, 4, .98), rgba(55, 10, 16, .96) 50%, rgba(1, 3, 4, .98)) !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .76) !important;
}

#v122-onboarding.v129-live-field .v122-brand-seal {
    width: 29px !important;
    height: 29px !important;
    font-size: 14px !important;
    outline-offset: 2px !important;
}

#v122-onboarding.v129-live-field .v122-brand-copy b {
    font-size: clamp(9px, 1.15vw, 12px) !important;
}

#v122-onboarding.v129-live-field .v122-brand-copy small {
    margin-top: 2px !important;
    font-size: 5.5px !important;
}

#v122-onboarding.v129-live-field .v122-progress span:not(.v122-progress-label) {
    width: clamp(12px, 2vw, 24px) !important;
}

#v122-onboarding.v129-live-field .v122-skip {
    min-height: 29px !important;
    padding: 0 10px !important;
    font-size: 8px !important;
}

#v129-tutorial-guide[hidden] {
    display: none !important;
}

#v129-tutorial-guide {
    position: fixed;
    inset: 0;
    z-index: 2147483490;
    width: 100%;
    height: var(--v128-app-height, 100dvh);
    overflow: hidden;
    pointer-events: none;
    contain: layout paint;
    font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.v129-focus-ring {
    --v129-focus-left: 50%;
    --v129-focus-top: 50%;
    --v129-focus-width: 0px;
    --v129-focus-height: 0px;
    position: fixed;
    left: var(--v129-focus-left);
    top: var(--v129-focus-top);
    z-index: 1;
    width: var(--v129-focus-width);
    height: var(--v129-focus-height);
    border: 2px solid var(--v129-speaker);
    border-radius: 9px;
    opacity: 0;
    box-shadow:
        0 0 18px var(--v129-speaker-glow),
        0 0 0 200vmax rgba(0, 0, 0, .38);
    transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease, opacity .18s ease;
    pointer-events: none;
}

.v129-focus-ring.show {
    opacity: 1;
}

.v129-guide-dialog {
    --v129-cut: 13px;
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 3;
    width: min(790px, calc(100vw - 16px));
    max-height: min(190px, calc(var(--v128-app-height, 100dvh) - 56px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: clamp(58px, 7.6vw, 86px) minmax(0, 1fr) minmax(96px, 126px);
    gap: clamp(7px, 1.2vw, 13px);
    align-items: stretch;
    padding: 9px 10px;
    overflow: hidden;
    pointer-events: auto;
    border: 1px solid color-mix(in srgb, var(--v129-speaker) 82%, #fff 18%);
    border-left: 4px solid var(--v129-speaker);
    color: #f2e5c1;
    background:
        linear-gradient(104deg, color-mix(in srgb, var(--v129-speaker) 11%, rgba(27, 7, 11, .98)), rgba(3, 6, 7, .985) 52%),
        var(--v129-panel);
    box-shadow: 0 18px 50px #000, 0 0 26px var(--v129-speaker-glow), inset 0 1px rgba(255, 255, 255, .07);
    clip-path: polygon(0 0, calc(100% - var(--v129-cut)) 0, 100% var(--v129-cut), 100% 100%, var(--v129-cut) 100%, 0 calc(100% - var(--v129-cut)));
}

.v129-guide-dialog::before {
    content: "LIVE FIELD COMMS";
    position: absolute;
    right: 14px;
    top: 7px;
    color: color-mix(in srgb, var(--v129-speaker) 33%, transparent);
    font: 700 6px/1 "Courier New", monospace;
    letter-spacing: .22em;
    pointer-events: none;
}

.v129-guide-dialog[data-placement="top"] {
    top: max(50px, calc(env(safe-area-inset-top) + 45px));
    bottom: auto;
}

.v129-guide-portrait {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--v129-speaker) 62%, transparent);
    background-position: 50% 16%;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: inset 0 -26px 28px #050607, 0 0 15px var(--v129-speaker-glow);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.v129-guide-portrait::after {
    content: "INSTRUCTOR";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 5px;
    color: var(--v129-speaker);
    font: 700 5.5px/1 "Courier New", monospace;
    letter-spacing: .14em;
    text-align: center;
    text-shadow: 0 1px 3px #000;
}

.v129-guide-copy {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.v129-guide-speaker {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.v129-guide-speaker strong {
    overflow: hidden;
    color: var(--v129-speaker);
    font-size: clamp(12px, 1.6vw, 17px);
    line-height: 1;
    letter-spacing: .1em;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 11px var(--v129-speaker-glow);
}

.v129-guide-speaker span {
    overflow: hidden;
    color: #8f846a;
    font: 700 6px/1 "Courier New", monospace;
    letter-spacing: .12em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v129-guide-voice {
    margin: 5px 0 0;
    overflow: hidden;
    color: #eedba9;
    font-size: clamp(9px, 1.1vw, 11px);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v129-guide-title {
    margin: 5px 0 3px;
    overflow: hidden;
    color: #fff0c3;
    font-size: clamp(12px, 1.45vw, 17px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .055em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v129-guide-body {
    margin: 0;
    overflow: hidden;
    color: #c4b99d;
    font-size: clamp(8.5px, .95vw, 10.5px);
    line-height: 1.42;
    -webkit-line-clamp: 5;
}

.v129-guide-hint {
    margin: 4px 0 0;
    overflow: hidden;
    color: #f0d68c;
    font: 700 clamp(7px, .82vw, 9px)/1.3 "Yu Gothic", sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v129-guide-hint::before {
    content: "ORDER / ";
    color: #8f762f;
    font-family: "Courier New", monospace;
    letter-spacing: .12em;
}

.v129-guide-actions {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
}

.v129-guide-step {
    color: #94876b;
    font: 700 6.5px/1.3 "Courier New", monospace;
    letter-spacing: .12em;
    text-align: right;
}

.v129-guide-step b {
    display: block;
    margin-top: 2px;
    color: var(--v129-speaker);
    font-size: 9px;
}

.v129-guide-feedback {
    min-height: 2.5em;
    overflow: hidden;
    color: #ad9f80;
    font-size: 7.5px;
    line-height: 1.25;
    text-align: right;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.v129-guide-feedback.error {
    color: #ef8b8f;
}

.v129-guide-feedback.good {
    color: #f2da91;
}

#v129-guide-action {
    min-height: 38px;
    padding: 5px 8px;
    border: 1px solid color-mix(in srgb, var(--v129-speaker) 78%, #fff 12%);
    border-radius: 2px;
    color: #160e08;
    background: linear-gradient(180deg, #f1d88a, #9b742b);
    box-shadow: 0 6px 15px #000, inset 0 1px rgba(255, 255, 255, .38);
    font: 800 9px/1.25 Georgia, "Yu Mincho", serif;
    letter-spacing: .06em;
    cursor: pointer;
    clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

#v129-guide-action[hidden] {
    display: none !important;
}

#v129-guide-action:focus-visible,
body.v129-tutorial-live .v129-control-target:focus-visible,
body.v129-tutorial-live .card.v129-target:focus-visible {
    outline: 3px solid var(--v129-gold-light) !important;
    outline-offset: 3px !important;
}

body.v129-tutorial-live .card.v129-target,
body.v129-tutorial-live .v129-control-target {
    z-index: 610 !important;
    border-color: var(--v129-gold-light) !important;
    outline: 2px solid rgba(255, 226, 137, .8) !important;
    box-shadow: 0 0 0 2px rgba(40, 23, 4, .84), 0 0 24px rgba(255, 197, 63, .9), 0 9px 18px #000 !important;
    animation: v129-target-pulse 1.15s ease-in-out infinite !important;
    cursor: pointer !important;
}

body.v129-tutorial-live .card.v129-pending {
    transform: translateY(-8px) scale(1.055) !important;
    filter: brightness(1.2) !important;
}

body.v129-tutorial-live .card.v129-slashed {
    opacity: .3 !important;
    transform: rotate(-7deg) scale(.88) !important;
    filter: grayscale(1) brightness(.56) contrast(1.2) !important;
    border-color: #8e1b25 !important;
    box-shadow: inset 0 0 22px rgba(70, 0, 5, .92), 0 0 0 1px rgba(230, 91, 99, .45) !important;
    pointer-events: none !important;
}

body.v129-tutorial-live .card.v129-slashed::after {
    content: "SLASH";
    position: absolute;
    left: -8%;
    right: -8%;
    top: 48%;
    z-index: 12;
    padding: 2px 0;
    border-block: 1px solid rgba(255, 134, 140, .78);
    color: #ffd8d8;
    background: rgba(93, 8, 14, .9);
    font: 900 7px/1 "Courier New", monospace;
    letter-spacing: .16em;
    text-align: center;
    transform: rotate(-24deg);
    text-shadow: 0 1px 2px #000;
}

body.v129-tutorial-live .card.v129-disabled {
    filter: brightness(.62) saturate(.58);
}

body.v129-tutorial-live .field-area,
body.v129-tutorial-live #hand-zone,
body.v129-tutorial-live #v42-field-card-side-actions,
body.v129-tutorial-live #v38-hand-action-controls {
    pointer-events: auto !important;
}

body.v129-tutorial-live #v38-hand-action-controls[hidden],
body.v129-tutorial-live #v42-field-card-side-actions[hidden] {
    display: none !important;
}

body.v129-tutorial-live #v38-hand-action-controls:not([hidden]),
body.v129-tutorial-live #v42-field-card-side-actions:not([hidden]) {
    z-index: 620 !important;
}

@keyframes v129-target-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.28) drop-shadow(0 0 8px rgba(255, 220, 124, .72)); }
}

@media (max-width: 620px) {
    body.v129-tutorial-live {
        padding-top: calc(42px + env(safe-area-inset-top)) !important;
    }
    #v122-onboarding.v129-live-field .v122-brand-copy small {
        display: none !important;
    }
    #v122-onboarding.v129-live-field .v122-progress {
        gap: 3px !important;
    }
    #v122-onboarding.v129-live-field .v122-progress span:not(.v122-progress-label) {
        width: 10px !important;
    }
    #v122-onboarding.v129-live-field .v122-progress-label {
        min-width: 40px !important;
        font-size: 5.5px !important;
    }
    .v129-guide-dialog {
        width: auto;
        max-height: 154px;
        grid-template-columns: 46px minmax(0, 1fr) 82px;
    }
    .v129-guide-dialog::before,
    .v129-guide-speaker span {
        display: none;
    }
    .v129-guide-speaker strong {
        font-size: 11px;
    }
    .v129-guide-voice {
        margin-top: 3px;
        font-size: 8px;
    }
    .v129-guide-title {
        margin-block: 3px 2px;
        font-size: 10.5px;
    }
    .v129-guide-body {
        font-size: 7.5px;
        line-height: 1.32;
        -webkit-line-clamp: 6;
    }
    .v129-guide-hint {
        margin-top: 2px;
        font-size: 6.7px;
    }
    .v129-guide-step {
        font-size: 5.5px;
    }
    .v129-guide-step b {
        font-size: 7.5px;
    }
    .v129-guide-feedback {
        font-size: 6.5px;
    }
    #v129-guide-action {
        min-height: 32px;
        padding: 3px 5px;
        font-size: 7.5px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    body.v129-tutorial-live {
        padding-top: calc(35px + env(safe-area-inset-top)) !important;
    }
    body.v129-tutorial-live.v45-battle-active.v64-shocker-battle {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        grid-template-rows: auto auto minmax(0, 1fr) !important;
        gap: 2px !important;
    }
    body.v129-tutorial-live.v45-battle-active.v64-shocker-battle #turn-info {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }
    body.v129-tutorial-live.v45-battle-active.v64-shocker-battle #phase-bar {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
    }
    body.v129-tutorial-live.v45-battle-active.v64-shocker-battle .opponent-area {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }
    body.v129-tutorial-live.v45-battle-active.v64-shocker-battle .player-area {
        grid-column: 2 !important;
        grid-row: 3 !important;
    }
    body.v129-tutorial-live #revolution-status {
        top: max(76px, calc(env(safe-area-inset-top) + 68px)) !important;
        width: min(400px, calc(100vw - 18px)) !important;
        padding-block: 2px !important;
        font-size: 7px !important;
    }
    #v122-onboarding.v129-live-field .v122-topbar {
        min-height: calc(34px + env(safe-area-inset-top)) !important;
        height: calc(34px + env(safe-area-inset-top)) !important;
        padding-block: calc(2px + env(safe-area-inset-top)) 2px !important;
    }
    #v122-onboarding.v129-live-field .v122-brand-seal {
        width: 24px !important;
        height: 24px !important;
        font-size: 11px !important;
    }
    #v122-onboarding.v129-live-field .v122-skip {
        min-height: 25px !important;
        font-size: 6.5px !important;
    }
    .v129-guide-dialog {
        top: auto;
        bottom: max(4px, env(safe-area-inset-bottom));
        right: auto;
        width: calc(50vw - 8px);
        max-height: 116px;
        grid-template-columns: 39px minmax(0, 1fr) 68px;
        gap: 4px;
        padding: 5px;
        margin: 0;
    }
    .v129-guide-dialog[data-placement="top"] {
        top: max(38px, calc(env(safe-area-inset-top) + 35px));
        bottom: auto;
    }
    .v129-guide-dialog[data-focus-side="player"] {
        left: max(4px, env(safe-area-inset-left));
        right: auto;
    }
    .v129-guide-dialog[data-focus-side="opponent"] {
        left: auto;
        right: max(4px, env(safe-area-inset-right));
    }
    .v129-guide-dialog[data-focus-side="none"] {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    .v129-guide-speaker strong {
        font-size: 9.5px;
    }
    .v129-guide-voice {
        font-size: 7px;
    }
    .v129-guide-title {
        font-size: 9px;
    }
    .v129-guide-body {
        font-size: 7px;
        line-height: 1.2;
        -webkit-line-clamp: 5;
    }
    .v129-guide-hint {
        font-size: 6.2px;
    }
    .v129-guide-feedback {
        min-height: 2.3em;
        font-size: 5.8px;
    }
    #v129-guide-action {
        min-height: 28px;
        font-size: 7.2px;
    }
}


/* v131 concise field coaching: one command, one optional rule line. */
.v129-guide-dialog {
    max-height: min(142px, calc(var(--v128-app-height, 100dvh) - 56px));
    grid-template-columns: clamp(52px, 6.8vw, 72px) minmax(0, 1fr) minmax(94px, 120px);
    align-items: center;
    padding: 7px 9px;
}

.v129-guide-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.v129-guide-speaker span,
.v129-guide-voice,
.v129-guide-hint {
    display: none !important;
}

.v129-guide-title {
    margin: 6px 0 0;
    color: #fff4cf;
    font-size: clamp(14px, 1.7vw, 19px);
    font-weight: 800;
    line-height: 1.18;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.v129-guide-title::before {
    content: "操作";
    display: inline;
    margin-right: 7px;
    color: var(--v129-speaker);
    font: 800 7px/1 "Courier New", "Yu Gothic", sans-serif;
    letter-spacing: .18em;
}

.v129-guide-dialog[data-mode="observe"] .v129-guide-title::before { content: "確認"; }
.v129-guide-dialog[data-mode="briefing"] .v129-guide-title::before { content: "教練"; }

.v129-guide-body {
    margin: 5px 0 0;
    color: #cfc4a8;
    font-size: clamp(9px, 1vw, 11px);
    font-weight: 650;
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.v129-guide-body[hidden],
.v129-guide-feedback[hidden] { display: none !important; }

.v129-guide-actions {
    justify-content: center;
    gap: 5px;
}

.v129-guide-feedback {
    min-height: 0;
    text-align: left;
}

.v130-selection-meter {
    min-height: 23px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 6px;
    padding: 4px 6px;
    border: 1px solid color-mix(in srgb, var(--v129-speaker) 48%, transparent);
    color: var(--v129-speaker);
    background: rgba(0, 0, 0, .52);
    font: 700 7px/1 "Courier New", monospace;
    letter-spacing: .1em;
}

.v130-selection-meter[hidden] { display: none !important; }
.v130-selection-meter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v130-selection-meter i { grid-column: 1; color: #ffe59b; font-style: normal; font-size: 10px; letter-spacing: .18em; }
.v130-selection-meter b { grid-column: 2; grid-row: 1 / span 2; font-size: 9px; white-space: nowrap; }

body.v129-tutorial-live .v130-observe-target {
    position: relative;
    z-index: 610 !important;
    outline: 2px solid var(--v129-gold-light) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 24px rgba(255, 197, 63, .72) !important;
}

body.v129-tutorial-live .graveyard-zone,
body.v129-tutorial-live .slash-zone {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    overflow: hidden !important;
    min-height: 20px !important;
}

body.v129-tutorial-live .v130-result-chip {
    position: relative !important;
    inset: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 25px !important;
    width: 25px !important;
    min-width: 25px !important;
    height: 18px !important;
    padding: 0 2px !important;
    box-sizing: border-box !important;
    border-radius: 4px !important;
    font-size: 8px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

body.v129-tutorial-live .v130-result-chip.v130-observe-target {
    outline-offset: -2px !important;
    box-shadow: inset 0 0 0 2px #ffe8a5, 0 0 8px rgba(255, 197, 63, .72) !important;
}

body.v129-tutorial-live .v130-history-chip {
    color: #9d947f !important;
    border-style: dashed !important;
    background: rgba(12, 12, 12, .9) !important;
}

body.v129-tutorial-live .card.v129-disabled {
    cursor: default !important;
}

#v129-guide-action:disabled {
    cursor: wait;
    filter: grayscale(.55) brightness(.62);
    opacity: .72;
}

@media (max-width: 620px) {
    .v129-guide-dialog {
        max-height: 124px;
        grid-template-columns: 44px minmax(0, 1fr) 84px;
        gap: 5px;
        padding: 6px;
    }
    .v129-guide-title { margin-top: 4px; font-size: 12px; }
    .v129-guide-title::before { margin-right: 5px; font-size: 6.5px; }
    .v129-guide-body { margin-top: 4px; font-size: 9px; }
    .v129-guide-step { font-size: 6px; }
    .v129-guide-step b { font-size: 8.5px; }
    .v129-guide-feedback { font-size: 7px; }
    #v129-guide-action { font-size: 9px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .v129-guide-dialog {
        max-height: 106px;
        grid-template-columns: 38px minmax(0, 1fr) 78px;
    }
    .v129-guide-title { margin-top: 3px; font-size: 10px; line-height: 1.12; }
    .v129-guide-title::before { margin-right: 4px; font-size: 6px; }
    .v129-guide-body { margin-top: 3px; font-size: 9px; line-height: 1.12; }
    .v129-guide-feedback { font-size: 7px; }
    .v129-guide-step { font-size: 6px; }
    .v129-guide-step b { font-size: 8.5px; }
    #v129-guide-action { min-height: 32px; font-size: 9px; }
    .v130-selection-meter { min-height: 19px; padding: 2px 4px; }
    body.v129-tutorial-live .disposal-box { height: clamp(25px, 8dvh, 36px) !important; }
    body.v129-tutorial-live .graveyard-zone,
    body.v129-tutorial-live .slash-zone { min-height: 16px !important; max-height: 16px !important; }
    body.v129-tutorial-live .v130-result-chip { flex-basis: 21px !important; width: 21px !important; min-width: 21px !important; height: 14px !important; font-size: 6px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .v129-focus-ring,
    body.v129-tutorial-live .card.v129-target,
    body.v129-tutorial-live .v129-control-target {
        animation: none !important;
        transition: none !important;
    }
}

/* v203: one opponent teaches the player as Riana. Conversation scrolls in
   its own bounded column; the action and selection controls remain outside. */
body.v129-tutorial-live #player-sub-battle-character,
body.v129-tutorial-live #opponent-sub-battle-character {
    display: none !important;
}

.v129-guide-dialog {
    max-height: min(272px, calc(var(--v128-app-height, 100dvh) - 62px));
    grid-template-columns: clamp(54px, 6.8vw, 78px) minmax(0, 1fr) minmax(98px, 122px);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
}

.v129-guide-dialog::before { content: "LIBRARY TABLE"; }
.v129-guide-portrait::after { content: "ララサ / 対戦相手"; }

.v129-guide-copy {
    min-height: 0;
    max-height: 244px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--v129-speaker) transparent;
    scrollbar-gutter: stable;
    justify-content: flex-start;
    padding-right: 5px;
    -webkit-overflow-scrolling: touch;
}

.v129-guide-copy:focus-visible {
    outline: 2px solid var(--v129-gold-light);
    outline-offset: -2px;
}

#v203-guide-pov {
    display: block;
    margin-bottom: 6px;
    color: #e2ba73;
    font: 700 10px/1.35 "Yu Gothic", sans-serif;
    letter-spacing: .04em;
}

.v129-guide-speaker strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-size: clamp(12px, 1.35vw, 15px);
    line-height: 1.3;
}

.v129-guide-voice,
#v203-guide-riana {
    display: block !important;
    overflow: visible;
    margin: 6px 0 0;
    color: #f3e6c7;
    font: 500 clamp(11px, 1.13vw, 13px)/1.55 Georgia, "Yu Mincho", serif;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-overflow: clip;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
}

.v129-guide-voice[hidden],
#v203-guide-riana[hidden] { display: none !important; }

#v203-guide-riana {
    padding: 6px 8px;
    border-left: 2px solid #ba9652;
    background: rgba(184, 143, 58, .09);
    color: #e5c98e;
}

#v203-guide-riana::before {
    content: attr(data-speaker) "：";
    color: #f2dcaa;
    font-size: .92em;
    font-weight: 700;
}

#v203-guide-riana[data-mode="thought"] { color: #d6c5a5; }

.v129-guide-title,
.v129-guide-body,
.v129-guide-feedback {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
}

.v129-guide-title {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
    margin: 0 0 8px;
    padding: 4px 0 5px;
    border-bottom: 1px solid rgba(223, 189, 104, .28);
    background: #0b0c0e;
    font-size: clamp(12px, 1.45vw, 16px);
    line-height: 1.3;
}

.v129-guide-body { font-size: 10px; line-height: 1.45; }
.v129-guide-actions { min-height: 0; align-self: stretch; justify-content: flex-end; }
.v129-guide-feedback { font-size: 9px; line-height: 1.4; }
#v129-guide-action { flex: 0 0 auto; min-height: 40px; font-size: 10px; }

@media (max-width: 620px) {
    .v129-guide-dialog {
        max-height: min(244px, calc(var(--v128-app-height, 100dvh) - 54px));
        grid-template-columns: 36px minmax(0, 1fr) 76px;
        gap: 5px;
        padding: 7px 6px;
    }
    .v129-guide-copy { max-height: 222px; padding-right: 3px; }
    .v129-guide-portrait::after { content: "LARASA"; font-size: 5px; }
    #v203-guide-pov { font-size: 9px; margin-bottom: 4px; }
    .v129-guide-speaker strong { font-size: 11px; }
    .v129-guide-voice,
    #v203-guide-riana { font-size: 11px; line-height: 1.45; margin-top: 5px; }
    #v203-guide-riana { padding: 5px 6px; }
    .v129-guide-title { font-size: 11px; margin: 0 0 6px; }
    .v129-guide-body { font-size: 9px; line-height: 1.4; }
    .v129-guide-feedback { font-size: 8px; }
    #v129-guide-action { min-height: 38px; font-size: 9px; padding: 5px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .v129-guide-dialog {
        width: calc(50vw - 8px);
        max-height: min(150px, calc(var(--v128-app-height, 100dvh) - 48px));
        grid-template-columns: 30px minmax(0, 1fr) 76px;
        padding: 5px;
        gap: 4px;
    }
    .v129-guide-copy { max-height: 138px; padding-right: 3px; }
    .v129-guide-portrait::after { content: "LARASA"; font-size: 4.5px; }
    #v203-guide-pov { font-size: 8px; margin-bottom: 3px; }
    .v129-guide-speaker strong { font-size: 10px; }
    .v129-guide-voice,
    #v203-guide-riana { font-size: 10px; line-height: 1.35; margin-top: 4px; }
    #v203-guide-riana { padding: 4px 5px; }
    .v129-guide-title { font-size: 10px; margin: 0 0 5px; }
    .v129-guide-body { font-size: 9px; line-height: 1.3; }
    .v129-guide-feedback { font-size: 8px; }
    #v129-guide-action { min-height: 34px; font-size: 9px; }
}
