        #control-panel {
            position: fixed;
            inset: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            background: rgba(0, 0, 0, 0.8);
            padding: 16px 0;
            z-index: 2000;
            box-sizing: border-box;
            overflow-y: auto;
        }

        #control-panel-options {
            position: relative;
            background-color: #ffffff;
            color: #000000;
            border: 6px solid #008080;
            border-radius: 8px;
            padding: 126px 28px 24px;
            width: 88%;
            max-width: 720px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            font-family: Arial, sans-serif;
            max-height: calc(100vh - 32px);
            overflow-y: auto;
        }

        #options-title-bar {
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            background: transparent;
            padding: 0;
            border-radius: 0;
            text-align: center;
            box-shadow: none;
            z-index: 10;
            width: min(92%, 620px);
        }

        #options-arcade-title {
            margin: 0 0 14px;
            font-family: 'Press Start 2P', cursive;
            font-size: clamp(1.8rem, 4.8vw, 2.5rem);
            color: #ff7a1a;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            text-shadow: 0 0 8px rgba(255, 170, 95, 0.5), 0 0 16px rgba(255, 102, 0, 0.45);
            line-height: 1.1;
        }

        #options-title-bar h2 {
            margin: 0;
            font-size: clamp(0.5rem, 1.05vw, 0.62rem);
            color: #1f4f4d;
            font-weight: 800;
            letter-spacing: 0.02em;
            line-height: 1.2;
        }

/* Main instructions style */
#control-panel-instructions {
  font-size: 18px;          /* bigger */
  font-weight: 800;         /* bolder */
  color: #1b1b1b;
  max-width: 640px;
  margin: 8px 0 12px;
  line-height: 1.35;
  letter-spacing: 0.2px;
  background: rgba(0, 150, 136, 0.08); /* subtle highlight */
  padding: 14px 16px;
  border-radius: 12px;

}

/* Tweak on medium-short screens */
@media (max-height: 820px) {
  #control-panel-instructions {
    font-size: 16px;         /* still larger than before */
    line-height: 1.3;
    margin: 6px 0 8px;
    padding: 12px 14px;
  }
}

/* Tweak on very short screens */
@media (max-height: 680px) {
  #control-panel-instructions {
    font-size: 15px;         /* readable but compact */
    line-height: 1.28;
    margin: 6px 0 6px;
    padding: 10px 12px;
  }
}

        #mode-divider {
            width: 100%;
            height: 2px;
            background-color: #009688;
            margin: 12px 0;
        }

        #options-inline-container {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 18px;
            width: 100%;
            margin-top: 8px;
            align-items: start;
            justify-items: center;
        }

        #options-inline-container .options-column {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 0 6px;
            margin: 0;
            text-align: center;
            min-width: 0;
        }

        #options-inline-container .options-column-summary {
            align-items: center;
            text-align: center;
            gap: 6px;
        }


        .button,
        .button:hover,
        .button:focus {
            box-shadow: none;
            outline: none;
        }

        .option-item {
            margin-bottom: 10px;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }

        .teal-label {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 17px;
            font-weight: bold;
            color: #333333;
            cursor: pointer;
            margin-bottom: 4px;
        }

        .summary-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .summary-heading {
            display: block;
            font-size: 15px;
            font-weight: bold;
            color: #009688;
        }

        .summary-value {
            font-size: 15px;
            font-weight: bold;
            color: #333333;
        }

        .summary-button-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            gap: 6px;
            text-align: center;
        }

        .summary-image-label {
            margin-bottom: 0;
        }

        .summary-button-item .teal-label {
            justify-content: center;
        }

        .styled-select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            width: min(100%, 240px);
            padding: 10px 36px 10px 16px;
            border: none;
            border-radius: 20px;
            background:
                #009688
                url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTcgMTBsNSA1IDUtNXoiLz48L3N2Zz4=")
                no-repeat right 12px center;
            background-size: 16px;
            font-size: 17px;
            font-weight: bold;
            color: #ffffff;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
            text-align: center;
            text-align-last: center;
        }

        .styled-select:hover,
        .styled-select:focus {
            outline: none;
            background-color: #00796B;
            box-shadow: 0 0 0 4px rgba(0, 150, 136, 0.15);
        }

        .styled-slider {
            -webkit-appearance: none;
            width: min(100%, 240px);
            height: 8px;
            border-radius: 999px;
            background: rgba(0, 150, 136, 0.3);
            outline: none;
            cursor: pointer;
            transition: box-shadow 0.3s ease;
            margin-top: 12px;
        }

        .slider-endpoints {
            display: flex;
            justify-content: space-between;
            width: min(100%, 240px);
            margin-top: 6px;
            font-size: 13px;
            font-weight: bold;
            color: #333333;
        }

        .styled-slider::-webkit-slider-runnable-track {
            height: 8px;
            background: #009688;
            border-radius: 999px;
        }

        .styled-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #ffffff;
            border: 2px solid #00796B;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
            margin-top: -6px;
        }

        .styled-slider::-moz-range-track {
            height: 8px;
            background: #009688;
            border-radius: 999px;
        }

        .styled-slider::-moz-range-thumb {
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: #ffffff;
            border: 2px solid #00796B;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        }

        .styled-slider:focus {
            box-shadow: 0 0 0 4px rgba(0, 150, 136, 0.15);
        }

        .button {
            background-color: #009688;
            color: #ffffff;
            border: none;
            border-radius: 20px;
            padding: 10px 36px;
            margin: 6px 4px;
            cursor: pointer;
            font-size: 17px;
            font-family: inherit;
            font-weight: bold;
            letter-spacing: 0.02em;
            transition: background 0.3s, transform 0.3s;
            width: min(100%, 240px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .summary-button-item .button {
            width: 100%;
        }

        .button:hover,
        .button.selected {
            background-color: #00796B;
        }

        #control-panel-start-button.button {
            background-color: #FF5722;
            color: #ffffff;
            border-radius: 30px;
            padding: 12px 24px;
            font-size: 17px;
            font-weight: bold;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            min-width: 190px;
            width: min(100%, 260px);
        }

        #control-panel-start-button.button:hover,
        #control-panel-start-button.button:focus {
            background-color: #E64A19;
            transform: scale(1.05);
        }

        #button-container {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 4px;
        }

        #control-panel-loading-bar-container {
            width: 100%;
            background: rgba(15, 20, 28, 0.65);
            border-radius: 14px;
            overflow: hidden;
            margin-bottom: 12px;
            height: 12px;
            box-shadow: 0 0 12px rgba(0, 150, 136, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        #control-panel-loading-status {
            width: 100%;
            text-align: center;
            font-size: 14px;
            color: #ffffff;
            margin-bottom: 8px;
            letter-spacing: 0.2px;
        }

        #control-panel-loading-bar {
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #5c1010, #b71c1c);
            border-radius: 12px;
            overflow: hidden;
            position: relative;
        }

        #control-panel-loading-bar .loading-bar-fill {
            height: 100%;
            width: 0%;
            background: linear-gradient(135deg, #02a791, #00c4a7);
            box-shadow: 0 0 10px rgba(0, 196, 167, 0.6);
            transition: width 0.35s ease;
        }


@media (max-width: 640px) {
    #stop-action-mode-segmented-control {
        width: min(100%, 100%);
        border-width: 2px;
        border-radius: 999px;
    }

    .stop-action-mode-btn {
        font-size: clamp(12px, 3.2vw, 16px);
        padding: clamp(8px, 1.8vw, 12px) clamp(6px, 1.4vw, 10px);
    }
}
@media (max-width: 900px) {
            #control-panel-options {
                padding: 56px 20px 20px;
            }

            #options-inline-container {
                grid-template-columns: 1fr;
            }

            #options-inline-container .options-column {
                align-items: center;
                border-right: none !important;
            }

            #options-inline-container .options-column:nth-child(2) {
                padding-right: 0;
            }

            .styled-select,
            .summary-button-item .button {
                max-width: none;
            }
        }

        @media (max-height: 820px) {
            #control-panel-options {
                padding: 52px 22px 18px;
            }

            #options-title-bar {
                top: 16px;
            }

            #options-title-bar h2 {
                font-size: 1.35rem;
            }

            #control-panel-instructions {
                font-size: 12px;
                line-height: 1.2;
                margin: 4px 0 2px;
            }
        }

        @media (max-height: 680px) {
            #control-panel {
                padding: 12px 0;
            }

            #control-panel-options {
                padding: 48px 18px 16px;
            }

            #options-title-bar h2 {
                font-size: 1.3rem;
            }

            .option-item {
                margin-bottom: 8px;
            }

            .button {
                margin: 4px 2px;
            }
        }


        #control-panel {
            align-items: stretch;
            justify-content: stretch;
            padding: 0;
            background:
                radial-gradient(circle at top left, rgba(0, 150, 136, 0.18), transparent 30%),
                linear-gradient(135deg, rgba(8, 16, 28, 0.98), rgba(5, 10, 18, 0.96));
            background-blend-mode: screen, normal;
        }

        #control-panel::before {
            content: none;
        }

        #control-panel-options {
            background: rgba(7, 14, 22, 0.72);
            border: none;
            border-radius: 0;
            padding: 0;
            width: 100vw;
            max-width: none;
            height: 100vh;
            max-height: none;
            box-shadow: none;
            overflow: hidden;
        }

        #options-title-bar {
            position: static;
            transform: none;
            width: 100%;
            background: transparent;
            border: none;
            box-shadow: none;
            padding: 0;
            text-align: center;
            margin-bottom: 18px;
        }

        #options-arcade-title {
            margin: 0;
            position: absolute;
            top: clamp(16px, 3vh, 32px);
            left: 50%;
            transform: translateX(-50%);
            width: min(90%, 560px);
            font-size: clamp(2rem, 4.8vw, 2.8rem);
            color: #ff7a1a;
            text-shadow: 0 0 10px rgba(255, 170, 95, 0.55), 0 0 18px rgba(255, 102, 0, 0.5);
        }

        #options-title-bar h2 {
            margin: 0;
            font-size: clamp(1.25rem, 2.25vw, 1.65rem);
            color: #143d3b;
            line-height: 1.05;
            text-shadow: none;
        }

        .game-menu-layout {
            display: grid;
            grid-template-columns: minmax(300px, 26vw) minmax(0, 1fr);
            gap: 0;
            width: 100%;
            height: 100%;
            align-items: stretch;
            min-height: 100vh;
        }

        .game-menu-main {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-width: 0;
            padding: clamp(20px, 4vh, 36px) clamp(18px, 2.6vw, 30px);
            position: relative;
            z-index: 1;
            background:
                radial-gradient(circle at top center, rgba(17, 185, 170, 0.14), transparent 30%),
                linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 252, 251, 0.97));
            border-right: 1px solid rgba(0, 150, 136, 0.16);
            overflow: hidden;
        }

        .game-menu-main::before,
        .game-menu-main::after {
            content: none;
        }

        .game-menu-art {
            display: flex;
            align-items: stretch;
            justify-content: stretch;
            min-width: 0;
            overflow: hidden;
        }

        .game-menu-art-card {
            width: 100%;
            min-height: 100%;
            padding: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: stretch;
            background: transparent;
            border: none;
            border-radius: 0;
            box-shadow: none;
        }

        .game-menu-art-image {
            width: 100%;
            min-height: 100%;
            border-radius: 0;
            background:
                linear-gradient(90deg, rgba(7, 14, 22, 0.18) 0%, rgba(7, 14, 22, 0.06) 10%, rgba(7, 14, 22, 0.01) 18%, rgba(7, 14, 22, 0) 28%),
                var(--menu-side-image, none) center center / 100% 100% no-repeat;
            box-shadow: none;
        }

        #control-panel-instructions {
            font-size: 1rem;
            margin: 0 0 30px;
            max-width: 340px;
            color: #587775;
            background: transparent;
            padding: 0;
            border: none;
            box-shadow: none;
            text-align: center;
            line-height: 1.55;
            position: relative;
            z-index: 1;
        }

        #mode-divider {
            display: none;
        }

        #options-inline-container {
            display: flex;
            flex-direction: column;
            gap: 24px;
            width: 100%;
            max-width: 390px;
            margin-top: 0;
            padding: 22px 0;
            border-top: 2px solid rgba(17, 185, 170, 0.22);
            border-bottom: 2px solid rgba(17, 185, 170, 0.22);
            align-items: stretch;
            justify-items: stretch;
            position: relative;
            z-index: 1;
        }

        #options-inline-container .options-column,
        #options-inline-container .summary-button-item,
        #options-inline-container .option-item {
            width: 100%;
            padding: 0;
            margin: 0;
        }

        .option-item {
            position: relative;
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 0;
            box-shadow: none;
            align-items: center;
            text-align: center;
            gap: 6px;
            overflow: visible;
        }

        .option-item::before {
            content: none;
        }

        .teal-label {
            justify-content: center;
            font-size: 0.88rem;
            font-weight: 800;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #1b4b47;
            text-align: center;
            margin-bottom: 0;
        }

        .summary-value {
            display: none;
        }

        .styled-select,
        .summary-button-item .button,
        #control-panel-start-button {
            width: auto;
            min-width: 210px;
            max-width: min(100%, 270px);
            margin-left: auto;
            margin-right: auto;
        }

        #control-panel-loading-bar-container {
            width: min(72%, 260px);
            max-width: none;
            margin-left: auto;
            margin-right: auto;
        }

        .styled-select {
            width: auto;
            min-width: 210px;
            max-width: min(100%, 270px);
            padding: 14px 34px 14px 18px;
            border-radius: 18px;
            background-color: #0ea89b;
            box-shadow: none;
            text-align: center;
            text-align-last: center;
            border: none;
        }

        .summary-button-item .button {
            border: none;
        }

        .styled-slider,
        .slider-endpoints,
        #button-container {
            width: 100%;
        }

        .styled-slider {
            margin-top: 4px;
        }

        .slider-endpoints {
            color: #587775;
        }

        .button,
        .button:hover,
        .button:focus {
            box-shadow: none;
            outline: none;
        }

        #button-container {
            margin-top: 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            width: 100%;
            max-width: 390px;
            padding: 0;
            border-radius: 0;
            background: transparent;
            border: none;
            box-shadow: none;
            position: relative;
            z-index: 1;
        }

        #button-container::before {
            content: none;
        }

        #control-panel-loading-bar-container {
            position: relative;
            display: flex;
            align-items: center;
            min-height: 20px;
            background: rgba(17, 185, 170, 0.14);
            border-radius: 999px;
            overflow: hidden;
            margin-bottom: 0;
            box-shadow: none;
            border: none;
        }

        #control-panel-loading-bar-container::after {
            content: attr(data-status);
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 12px;
            color: #155b56;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            text-shadow: none;
        }

        #control-panel-loading-bar {
            width: 0%;
            height: 100%;
            min-height: 20px;
            border-radius: inherit;
            background: linear-gradient(90deg, #11b9aa, #65e8c3);
            box-shadow: none;
            transition: width 0.3s ease, filter 0.3s ease;
        }

        #control-panel-loading-bar-container.is-ready {
            background: rgba(17, 185, 170, 0.18);
        }

        #control-panel-loading-bar-container.is-ready #control-panel-loading-bar {
            filter: saturate(1.08);
        }

        #control-panel-start-button {
            padding: 14px 20px;
            border-radius: 18px;
            background: #ff5b2e;
            border: none;
            color: #ffffff;
        }

        #control-panel-start-button:hover,
        #control-panel-start-button:focus {
            background: #e65229;
            border: none;
        }

        #control-panel-start-button[disabled] {
            opacity: 0.6;
            cursor: not-allowed;
            box-shadow: none;
        }

        @media (max-height: 860px) {
            .game-menu-layout {
                grid-template-columns: minmax(280px, 24vw) minmax(0, 1fr);
            }

            .game-menu-main {
                padding-block: 24px;
            }

            #options-title-bar {
                margin-bottom: 14px;
            }

            #options-arcade-title {
                top: clamp(12px, 2.4vh, 24px);
                font-size: clamp(1.7rem, 4vw, 2.3rem);
            }

            #options-title-bar h2 {
                font-size: clamp(1.05rem, 1.95vw, 1.4rem);
            }

            #control-panel-instructions {
                font-size: 0.92rem;
                margin-bottom: 20px;
                line-height: 1.45;
            }

            #options-inline-container {
                gap: 20px;
                padding: 16px 0;
            }

            .styled-select,
            .summary-button-item .button,
            #control-panel-start-button {
                min-width: 190px;
                max-width: min(100%, 240px);
            }

            .styled-select,
            #control-panel-start-button {
                padding-top: 12px;
                padding-bottom: 12px;
                border-radius: 16px;
            }

            #control-panel-loading-bar-container {
                width: min(68%, 230px);
            }

            #button-container {
                gap: 12px;
                margin-top: 18px;
            }
        }

        @media (max-height: 740px) {
            .game-menu-layout {
                grid-template-columns: minmax(250px, 22vw) minmax(0, 1fr);
            }

            .game-menu-main {
                padding-block: 16px;
            }

            #options-title-bar {
                margin-bottom: 10px;
            }

            #options-arcade-title {
                top: clamp(8px, 1.8vh, 16px);
                font-size: clamp(1.45rem, 3.2vw, 1.85rem);
            }

            #options-title-bar h2 {
                font-size: clamp(0.95rem, 1.7vw, 1.2rem);
            }

            #control-panel-instructions {
                font-size: 0.84rem;
                margin-bottom: 14px;
                max-width: 290px;
            }

            #options-inline-container {
                gap: 16px;
                padding: 12px 0;
                max-width: 320px;
            }

            .option-item {
                gap: 4px;
            }

            .teal-label {
                font-size: 0.76rem;
            }

            .styled-select,
            .summary-button-item .button,
            #control-panel-start-button {
                min-width: 170px;
                max-width: min(100%, 210px);
            }

            .styled-select {
                padding: 10px 30px 10px 14px;
                font-size: 0.9rem;
            }

            #control-panel-start-button {
                padding: 10px 16px;
                font-size: 0.92rem;
            }

            #control-panel-loading-bar-container {
                width: min(64%, 200px);
                min-height: 18px;
            }

            #control-panel-loading-bar,
            #control-panel-loading-bar-container::after {
                min-height: 18px;
            }

            #control-panel-loading-bar-container::after {
                font-size: 10px;
            }

            #button-container {
                gap: 10px;
                margin-top: 14px;
                max-width: 320px;
            }
        }

        @media (max-width: 980px) {
            #control-panel-options {
                width: 100%;
                height: auto;
                min-height: 100vh;
            }

            .game-menu-layout {
                grid-template-columns: 1fr;
                min-height: 100vh;
                height: auto;
            }

            .game-menu-main {
                padding: 24px 18px;
                justify-content: flex-start;
                order: 2;
            }

            #options-inline-container,
            #button-container {
                max-width: 340px;
            }

            .styled-select,
            .summary-button-item .button,
            #control-panel-start-button {
                min-width: 190px;
                max-width: min(100%, 240px);
            }

            #control-panel-loading-bar-container {
                width: min(72%, 240px);
            }

            .game-menu-art {
                order: 1;
                min-height: 42vh;
            }

            .game-menu-art-image {
                min-height: 42vh;
            }
        }

#language-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 99999;
    padding: 6px 10px;
    border-radius: 10px;
    border: 2px solid #009688;
    background: #fff;
    color: #009688;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.video-stop-action-page .video-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10;
}

.video-stop-action-page .video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 180ms ease;
}

.video-stop-action-page .video-player.is-paused-zoom {
    transform: scale(1.08);
}

.stop-action-menu-layout {
    width: 100%;
    align-items: stretch;
}

.stop-action-options-inline-container {
    grid-template-columns: minmax(0, 1fr);
    max-width: 580px;
    margin: 0 auto;
}

.stop-action-mode-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

#stop-action-mode-segmented-control {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: min(100%, 520px);
    margin: 6px auto 0;
    border: clamp(2px, 0.42vw, 4px) solid #000000;
    border-radius: 999px;
    background-color: #e6e6e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    overflow: hidden;
}

#input-mode-segmented-control {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: min(100%, 420px);
    margin: 6px auto 0;
    border: clamp(2px, 0.42vw, 4px) solid #000000;
    border-radius: 999px;
    background-color: #2c2c2c;
    box-shadow: 0 2px 5px rgba(0,0,0,0.18);
    overflow: hidden;
}

.stop-action-mode-btn {
    flex: 1;
    min-width: 0;
    padding: clamp(7px, 1vw, 11px) clamp(6px, 1vw, 10px);
    font-size: clamp(11px, 1.4vw, 17px);
    font-weight: 800;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: #000000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 560px) {
    #stop-action-mode-segmented-control {
        width: 100%;
        min-height: 52px;
    }

    #input-mode-segmented-control {
        width: 100%;
        min-height: 52px;
    }

    .stop-action-mode-btn {
        font-size: clamp(9px, 2.6vw, 12px);
        padding: 7px 4px;
        letter-spacing: 0;
        white-space: normal;
        line-height: 1.05;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 420px) {
    .stop-action-mode-btn {
        font-size: clamp(6px, 2.2vw, 8px);
        padding: 6px 3px;
        font-weight: 700;
    }

    #control-panel-instructions {
        font-size: 0.82rem;
        line-height: 1.35;
        margin-bottom: 10px;
    }

    #options-title-bar h2 {
        font-size: clamp(0.78rem, 3.2vw, 0.95rem);
    }
}

@media (max-width: 340px) {
    .stop-action-mode-btn {
        font-size: clamp(6px, 2.2vw, 8px);
        padding: 4px 2px;
    }
}

.stop-action-mode-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.stop-action-mode-btn.selected {
    background: linear-gradient(135deg, #009688, #00796B);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

#input-mode-segmented-control .stop-action-mode-btn.selected {
    background: #ff5b2e;
    color: #ffffff;
    box-shadow: none;
}

.stop-action-mode-btn:not(:last-child) {
    border-right: clamp(2px, 0.42vw, 4px) solid #000000;
}

#input-mode-segmented-control .stop-action-mode-btn:not(:last-child) {
    border-right: clamp(2px, 0.42vw, 4px) solid #5a5a5a;
}

.stop-action-mode-description {
    margin: 12px 0 0;
    color: #1f1f1f;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.stop-action-button-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
    align-items: center;
}

#control-panel-loading-bar-container {
    width: min(72%, 320px);
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 150, 136, 0.14);
    border: 2px solid rgba(0, 150, 136, 0.35);
    position: relative;
}

#control-panel-loading-bar-container::after {
    content: attr(data-status);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #004d46;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#control-panel-loading-bar-container.is-ready::after {
    color: #ffffff;
}

#control-panel-loading-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #00c4b3 0%, #009688 100%);
    transition: width 0.25s ease;
}

#control-panel-start-button.is-disabled {
    opacity: 0.6;
    cursor: wait;
}

.overlay-screen {
    position: fixed;
    inset: 0;
    display: none;
    grid-auto-flow: row;
    justify-items: center;
    align-content: center;
    place-content: center;
    gap: 30px;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.82);
    z-index: 30;
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
}

.overlay-screen.show {
    display: grid;
}

.overlay-screen.hidden {
    display: none;
}

.action-prompt-image {
    display: block;
    width: min(78vw, 440px);
    max-width: 440px;
    margin: 0 auto;
    align-self: center;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.action-prompt-label {
    margin: 0;
    color: #ffffff;
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(1.2rem, 3.1vw, 2rem);
    line-height: 1.6;
    text-align: center;
}

.action-prompt-tile {
    position: relative;
    width: min(78vw, 520px);
    aspect-ratio: 1 / 1;
    padding: clamp(18px, 3vw, 26px);
    border-radius: 26px;
    border: 4px solid rgba(255, 255, 255, 0.86);
    background: linear-gradient(180deg, rgba(12, 20, 21, 0.95), rgba(0, 0, 0, 0.95));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    display: grid;
    place-items: center;
    gap: 20px;
    overflow: hidden;
}

.overlay-screen.eyegaze-mode {
    position: fixed;
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-hard-layout,
.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-competitive-layout {
    position: absolute;
    left: var(--eyegaze-tile-x, 50%);
    top: var(--eyegaze-tile-y, 50%);
    transform: translate(-50%, -50%);
    margin: 0;
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-hard-layout {
    width: min(58.5vw, 390px);
    aspect-ratio: 1 / 1;
    padding: clamp(14px, 2.2vw, 20px);
    border-radius: 22px;
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-competitive-layout {
    width: min(39vw, 260px);
    aspect-ratio: 1 / 1;
    padding: clamp(10px, 1.8vw, 16px);
    border-radius: 18px;
}

.overlay-screen.eyegaze-mode .action-prompt-tile .action-prompt-image {
    width: 72%;
    max-width: none;
}

.overlay-screen.eyegaze-mode .action-prompt-tile .action-prompt-label {
    font-size: clamp(1rem, 2.25vw, 1.45rem);
    line-height: 1.35;
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-hard-layout .action-prompt-image {
    width: 68%;
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-hard-layout .action-prompt-label {
    font-size: clamp(0.9rem, 1.95vw, 1.2rem);
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-competitive-layout .action-prompt-image {
    width: 62%;
}

.overlay-screen.eyegaze-mode .action-prompt-tile.eyegaze-competitive-layout .action-prompt-label {
    font-size: clamp(0.72rem, 1.5vw, 0.95rem);
    line-height: 1.28;
}

.overlay-screen:not(.eyegaze-mode) .action-prompt-tile {
    background: transparent;
    border: none;
    box-shadow: none;
    min-height: 0;
    width: auto;
    padding: 0;
    overflow: visible;
    gap: 30px;
}

.action-prompt-dwell-fill {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    background-color: rgba(255, 0, 0, 0.52);
    pointer-events: none;
    z-index: 2;
}

.action-prompt-tile .action-prompt-image,
.action-prompt-tile .action-prompt-label {
    position: relative;
    z-index: 1;
}

.hide-native-cursor,
.hide-native-cursor * {
    cursor: none !important;
}

#gazePointer {
    position: fixed;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.68);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 2147483647;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.24);
}

.stop-action-results-metric {
    margin: 6px 0;
    color: #f1f1f1;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

#results-score.stop-action-results-metric {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 6px 0 14px;
}

.stop-action-score-label,
.stop-action-score-value {
    display: block;
    text-align: center;
}

.stop-action-score-label {
    font-size: 0.42em;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.stop-action-score-value {
    font-size: 1em;
    font-weight: 900;
}

#results-average-delay.stop-action-results-metric,
#results-false-positives.stop-action-results-metric {
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
}

.action-prompt-image.is-pulsing,
.action-prompt-label.is-pulsing {
    animation: promptPulse 2.5s ease-in-out infinite;
}

@keyframes promptPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
    }
}

.action-prompt-image.hard-mode-countdown,
.action-prompt-label.hard-mode-countdown {
    animation: hardModeShrink 5s linear forwards;
}

@keyframes hardModeShrink {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

#results-screen .results-panel.stop-action-results-panel {
    text-align: center;
    width: min(98vw, 1120px);
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 18px);
    max-width: none;
    transform: none;
    opacity: 1;
    border: 3px solid rgba(0, 150, 136, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(17, 28, 30, 0.96), rgba(8, 17, 18, 0.95));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: clamp(14px, 2.3vw, 24px);
    overflow: hidden;
}

#results-screen .results-panel.stop-action-results-panel h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3.2vw, 2.3rem);
}

.stop-action-results-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(460px, 700px);
    gap: clamp(10px, 2vw, 20px);
    align-items: stretch;
    justify-content: center;
    width: 100%;
}

.stop-action-results-column {
    border: 2px solid rgba(0, 150, 136, 0.7);
    border-radius: 14px;
    background: rgba(5, 14, 15, 0.66);
    padding: clamp(12px, 1.8vw, 18px);
    min-height: 0;
    overflow: hidden;
}

.stop-action-results-column-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.score-register-panel {
    width: 100%;
    margin-top: 10px;
}

.leaderboard-panel {
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
}

.score-register-form .button {
    width: min(100%, 260px);
    margin-top: 4px;
    background: linear-gradient(180deg, #17a194, #0f7f74);
}

.score-register-form .button:hover,
.score-register-form .button:focus {
    background: linear-gradient(180deg, #14b0a0, #0f8f82);
}

.score-register-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.score-player-name-label {
    color: #f1f1f1;
    font-weight: 700;
    font-size: 0.95rem;
}

.score-player-name-input {
    width: min(100%, 260px);
    border-radius: 14px;
    border: 2px solid rgba(0, 150, 136, 0.9);
    background: rgba(255, 255, 255, 0.96);
    color: #052023;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 700;
}

.score-player-name-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 150, 136, 0.3);
}

.score-register-status {
    min-height: 22px;
    margin: 2px 0 0;
    color: #9ff6c7;
    font-size: 0.95rem;
    font-weight: 700;
}

.score-register-status.is-error {
    color: #ffb3b3;
}

.leaderboard-title {
    margin: 0 0 8px;
    color: #19f5a8;
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    text-align: center;
    letter-spacing: 0.02em;
    text-shadow: 0 0 8px rgba(15, 255, 170, 0.35);
    font-family: 'Press Start 2P', cursive;
}

.leaderboard-list {
    margin: 0;
    padding: 0 8px;
    color: #d2fff1;
    text-align: center;
    max-width: none;
    display: block;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.leaderboard-list li {
    margin: 0 0 12px;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(0, 150, 136, 0.38);
    word-break: break-word;
    font-family: 'Press Start 2P', cursive;
    list-style-position: inside;
}

#results-screen {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    z-index: 40;
    padding: 14px;
    overflow: hidden;
}

#results-screen.show {
    display: flex;
}

#continue-button {
    width: min(100%, 280px);
    align-self: center;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .stop-action-menu-layout {
        flex-direction: column;
    }

    .game-menu-art {
        display: none;
    }

    .action-prompt-image {
        width: min(88vw, 360px);
    }

    #results-screen .results-panel.stop-action-results-panel {
        width: min(96vw, 740px);
        max-height: calc(100vh - 12px);
    }

    .stop-action-results-layout {
        grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr);
        gap: 8px;
        justify-content: center;
    }

    .stop-action-results-column {
        padding: 12px;
    }

    .leaderboard-list {
        max-height: none;
    }
}

@media (max-height: 800px) {
    #results-screen .results-panel.stop-action-results-panel {
        width: min(98vw, 1080px);
        max-height: calc(100vh - 8px);
        padding: 8px;
        gap: 6px;
    }

    #results-screen .results-panel.stop-action-results-panel h2 {
        font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    }

    .stop-action-results-layout {
        grid-template-columns: minmax(210px, 300px) minmax(320px, 1fr);
        gap: 8px;
    }

    .stop-action-results-column {
        padding: 8px;
    }

    #results-score.stop-action-results-metric {
        font-size: clamp(1.2rem, 3vw, 1.7rem);
        margin: 1px 0 6px;
    }

    .stop-action-results-metric {
        margin: 2px 0;
        font-size: 11px;
        line-height: 1.25;
    }

    .stop-action-score-label {
        font-size: 0.5em;
    }

    .score-player-name-label {
        font-size: 0.7rem;
    }

    .score-register-form {
        gap: 6px;
        margin-top: 4px;
    }

    .score-player-name-input {
        padding: 6px 8px;
        font-size: 12px;
    }

    .score-register-form .button {
        width: min(100%, 220px);
        padding: 8px 10px;
        font-size: 12px;
        margin-top: 0;
    }

    .leaderboard-title {
        font-size: clamp(0.95rem, 1.8vw, 1.2rem);
        margin: 0 0 4px;
    }

    .leaderboard-list {
        padding: 0 4px;
    }

    .leaderboard-list li {
        font-size: clamp(0.72rem, 1.25vw, 0.9rem);
        line-height: 1.25;
        margin: 0 0 5px;
        padding: 5px 7px;
    }

    #continue-button {
        width: min(100%, 240px);
        margin-top: 0;
        padding: 8px 10px;
        font-size: 12px;
    }
}
