body.bit101-games [data-scene-game="tunnel"]{
    isolation:isolate;
    background:#dce3e4;
}

body.bit101-games .game-shell[data-game-id="tunnel"] [data-bit101-numeral-enhanced="true"]{
    font-variant-numeric:normal;
}

body.bit101-games .game-shell[data-game-id="tunnel"] .bit101-numeral-source{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0 0 0 0);
    white-space:nowrap;
    border:0;
}

body.bit101-games .game-shell[data-game-id="tunnel"] .bit101-numeral-visual{
    display:inline-flex;
    align-items:baseline;
    justify-content:center;
    white-space:pre-wrap;
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression .bit101-numeral-run{
    font-size:1em;
    color:inherit;
    filter:drop-shadow(0 2px 1px rgba(0,0,0,.34)) drop-shadow(0 0 8px rgba(111,227,215,.5));
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression{
    top:calc(max(12px,env(safe-area-inset-top)) + var(--game-tool-size) + var(--game-expression-gap));
    right:max(12px,env(safe-area-inset-right));
    left:auto;
    display:none;
    box-sizing:border-box;
    width:var(--game-expression-width);
    min-width:0;
    height:var(--game-expression-height);
    min-height:0;
    padding:clamp(7px,1.2vmin,10px) clamp(10px,1.8vmin,14px);
    transform:none;
    border:clamp(3px,.55vmin,4px) solid #aebdc2;
    border-radius:var(--game-screen-radius);
    background:
        radial-gradient(circle at 13px 13px,#7df5e4 0 2px,transparent 3px),
        radial-gradient(circle at calc(100% - 13px) 13px,#7df5e4 0 2px,transparent 3px),
        repeating-linear-gradient(0deg,transparent 0 6px,rgba(126,246,255,.045) 6px 7px),
        linear-gradient(145deg,rgba(8,29,43,.97),rgba(10,67,76,.93));
    box-shadow:
        0 0 0 2px rgba(22,51,62,.98),
        0 16px 34px rgba(0,0,0,.34);
    color:#fff;
    font-size:var(--game-expression-font);
    text-shadow:0 0 12px rgba(202,248,255,.4),0 2px 2px rgba(0,0,0,.72);
}

body.bit101-games .game-shell[data-game-id="tunnel"][data-playing="true"] .game-expression{
    display:grid;
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression::before{
    content:none;
    display:none;
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression::after{
    content:none;
    display:none;
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression[data-expression-state="correct"]{
    border-color:rgba(112,255,184,.9);
    color:#cdffe5;
    box-shadow:0 0 0 3px rgba(80,227,154,.14),inset 0 0 22px rgba(80,227,154,.2),0 10px 28px rgba(0,0,0,.2),0 0 22px rgba(75,214,143,.2);
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression[data-expression-state="wrong"]{
    border-color:rgba(210,112,143,.86);
    color:#efcdd8;
    box-shadow:0 0 0 3px rgba(170,74,111,.11),inset 0 0 22px rgba(180,72,112,.16),0 10px 28px rgba(0,0,0,.2),0 0 20px rgba(153,62,103,.16);
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-renderer-fallback .bit101-numeral-run{
    color:#fff;
    filter:drop-shadow(0 1px 1px rgba(0,0,0,.38));
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-tutorial__equation .bit101-numeral-run{
    color:#095f66;
    filter:drop-shadow(0 1px 0 rgba(255,255,255,.82));
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-result__card .bit101-numeral-run{
    color:#28424b;
    filter:drop-shadow(0 1px 0 rgba(255,255,255,.82));
}

/* The Tunnel selector preview is the visual authority for this three-lane control family. */
body.bit101-games .game-shell[data-game-id="tunnel"] .game-steering{
    right:max(clamp(24px,2.6vw,40px),env(safe-area-inset-right));
    left:max(clamp(24px,2.6vw,40px),env(safe-area-inset-left));
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-steer{
    width:clamp(82px,13vw,200px);
    height:clamp(82px,13vw,200px);
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-direction-icon{
    width:100%;
    height:100%;
}

@media (hover:hover){
    body.bit101-games .game-shell[data-game-id="tunnel"] .game-steer:not(:disabled):hover{
        filter:brightness(1.1);
    }
}

body.bit101-games .game-shell[data-game-id="tunnel"] .game-steer:not(:disabled):active{
    filter:brightness(.94);
}

@media(max-height:420px) and (orientation:landscape){
    body.bit101-games .game-shell[data-game-id="tunnel"] .game-steer{
        width:clamp(72px,13vw,104px);
        height:clamp(72px,13vw,104px);
    }
}

body.bit101-games .tunnel-scene{
    position:absolute;
    inset:0;
    overflow:hidden;
    background:
        radial-gradient(circle at 50% 42%,rgba(255,255,255,.92),rgba(226,232,233,.72) 52%,rgba(177,191,195,.84));
}

body.bit101-games .tunnel-scene__canvas{
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    height:100%;
    contain:strict;
    touch-action:none;
}

body.bit101-games .tunnel-scene__canvas[hidden]{
    display:none;
}

body.bit101-games .tunnel-scene__fallback{
    position:absolute;
    z-index:1;
    left:50%;
    bottom:max(88px,calc(env(safe-area-inset-bottom) + 72px));
    display:grid;
    width:min(286px,calc(100% - 48px));
    translate:-50% 0;
    gap:2px;
    padding:10px 14px;
    border:1px solid rgba(255,255,255,.68);
    border-radius:18px;
    background:rgba(230,236,237,.78);
    box-shadow:0 12px 34px rgba(40,55,59,.12);
    color:#33474d;
    text-align:center;
    -webkit-backdrop-filter:blur(9px);
    backdrop-filter:blur(9px);
    pointer-events:none;
}

body.bit101-games .tunnel-scene__fallback[hidden]{
    display:none;
}

body.bit101-games .tunnel-scene__fallback span{
    font-size:12px;
    font-weight:800;
    letter-spacing:.04em;
}

body.bit101-games .tunnel-scene__fallback small{
    color:#607176;
    font-size:11px;
}

body.bit101-games [data-scene-game="tunnel"][data-renderer-status="context-lost"] .tunnel-scene,
body.bit101-games [data-scene-game="tunnel"][data-renderer-status="fallback"] .tunnel-scene{
    background:
        repeating-radial-gradient(circle at 50% 48%,transparent 0 34px,rgba(71,91,97,.08) 35px 36px),
        linear-gradient(160deg,#f2f5f5,#cfd9da);
}

body.bit101-games [data-scene-game="tunnel"][data-paused="true"] .tunnel-scene__canvas{
    filter:saturate(.45) brightness(.96);
}

@media(max-width:560px){
    body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression{
        top:calc(max(12px,env(safe-area-inset-top)) + var(--game-tool-size) + var(--game-expression-gap));
        bottom:auto;
        right:max(12px,env(safe-area-inset-right));
        left:auto;
        width:var(--game-expression-width);
        min-width:0;
        height:var(--game-expression-height);
        min-height:0;
        padding:7px 9px;
        transform:none;
        font-size:var(--game-expression-font);
    }

    body.bit101-games .tunnel-scene__fallback{
        bottom:max(104px,calc(env(safe-area-inset-bottom) + 88px));
        width:min(248px,calc(100% - 40px));
        padding:9px 12px;
    }
}

@media(max-height:520px) and (orientation:landscape){
    body.bit101-games .game-shell[data-game-id="tunnel"] .game-expression{
        top:calc(max(12px,env(safe-area-inset-top)) + var(--game-tool-size) + var(--game-expression-gap));
        right:max(12px,env(safe-area-inset-right));
        bottom:auto;
        left:auto;
        width:var(--game-expression-width);
        min-width:0;
        height:var(--game-expression-height);
        min-height:0;
        transform:none;
        font-size:var(--game-expression-font);
    }

    body.bit101-games .tunnel-scene__fallback{
        bottom:max(56px,calc(env(safe-area-inset-bottom) + 44px));
        width:min(240px,calc(100% - 32px));
        padding:7px 10px;
    }
}

@media(prefers-reduced-motion:reduce){
    body.bit101-games .tunnel-scene__canvas{
        transition:none;
    }
}

/* Keep the brief physical cutoff visually steady; input remains disabled. */
body.bit101-games .game-shell[data-game-id="tunnel"][data-tunnel-choice-closed="true"] .game-steer:disabled{
    opacity:1;
    filter:none;
    cursor:pointer;
}
