.sr-only {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
            overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
        }

        :focus-visible { outline: 3px solid var(--secondary-color, #008AFF); outline-offset: 2px; }

        /* --- UI Components --- */
        #game-container { display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: 20px; }

        .game-card {
            background-color: var(--color-white, #ffffff); border-radius: 8px; border: 1px solid var(--border-color, #e2e8f0);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); padding: 2rem; margin-bottom: 2rem; width: 100%;;
        }

        .game-label { display: block; font-size: 0.875rem; font-weight: bold; color: var(--color-gray, #4a5568); margin-bottom: 0.5rem; }

        .game-select {
            width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #cbd5e0; border-radius: 0.375rem;
            font-size: 1rem; background-color: var(--color-white, #ffffff); color: #1a202c;
        }

        .game-btn {
            background-color: var(--main-color, #1A48EE); color: var(--color-white, #ffffff); font-weight: bold;
            padding: 0.75rem 1.5rem; border: none; border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); cursor: pointer; font-size: 0.95rem;
            transition: all 0.2s ease;
        }
        .game-btn:hover { background-color: var(--secondary-color, #008AFF); transform: translateY(-1px); }
        .game-btn.active { background-color: var(--tertiary-color); box-shadow: 0 0 0 3px rgba(0, 138, 255, 0.3); }
        .game-btn.primary { background-color: var(--color-contrast-green); }
        .game-btn.primary:hover { background-color: var(--color-green-dark, #047857); }
        .game-btn.secondary { background-color: var(--color-gray, #4a5568); }

        .control-group { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; width: 100%; }
        #status { font-size: 1.2rem; font-weight: bold; text-align: center; min-height: 1.5em; margin-bottom: 5px; color: var(--main-color, #1A48EE); }

        /* --- Interactive Board Grid --- */
        .board-layout {
            display: grid;
            grid-template-columns: 25px 1fr;
            grid-template-rows: 25px 1fr;
            gap: 4px;
            width: 100%;
            max-width: 600px;
            margin-bottom: 2rem;
        }

        .col-labels {
            grid-column: 2;
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            text-align: center;
            font-weight: bold;
            color: var(--color-gray, #4a5568);
            align-items: end;
        }

        .row-labels {
            grid-column: 1;
            display: grid;
            grid-template-rows: repeat(8, 1fr);
            text-align: right;
            padding-right: 5px;
            font-weight: bold;
            color: var(--color-gray, #4a5568);
            align-items: center;
        }

        .board-core {
            grid-column: 2;
            position: relative;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            border: 4px solid var(--border-color, #e2e8f0);
            border-radius: 8px;
            background-color: #ecf0f1;
            overflow: hidden;
            aspect-ratio: 1 / 1;
            width: 100%;
        }

        #gameCanvas {
            width: 100%;
            height: 100%;
            display: block;
        }

         /* Overlay mapping logic */
        #a11y-overlay {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            display: flex;
            flex-direction: column;
            z-index: 10;
        }

        .a11y-row {
            display: flex;
            flex-direction: row;
            flex: 1 1 0;
            width: 100%;
        }

        .a11y-btn {
            display: block;
            flex: 1 1 0;
            background: transparent;
            border: none;
            padding: 0;
            margin: 0;
            cursor: default;
            transition: background 0.2s ease;
            -webkit-tap-highlight-color: transparent;
        }

        .a11y-btn:not([aria-disabled="true"]) { cursor: pointer; }
        
        /* Only apply hover highlights on devices with a mouse, prevents "sticky" touches on mobile */
        @media (hover: hover) {
            .a11y-btn:not([aria-disabled="true"]):hover { background: rgba(46, 204, 113, 0.2); }
        }
        
        .a11y-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 4px var(--secondary-color, #008AFF); background: rgba(0, 138, 255, 0.2); }

        /* General Info Container */
        .info-title { font-size: 1.4rem; font-weight: bold; color: var(--main-color, #1A48EE); border-bottom: 2px solid var(--border-color, #e2e8f0); padding-bottom: 10px; margin-bottom: 15px; }
        .info-content { font-size: 1rem; line-height: 1.7; color: #4a5568; }
        .info-content ul { padding-left: 20px; margin: 10px 0; }
        .info-content li { margin-bottom: 12px; }

        /* Modals */
        .modal-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); z-index: 100;
            justify-content: center; align-items: center;
        }
        .modal-content {
            background: var(--color-white, #ffffff); color: #1a202c; padding: 30px; border-radius: 12px; text-align: center;
            max-width: 90%; width: 500px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
        }
        .modal-title { font-size: 1.8rem; margin-bottom: 15px; color: var(--main-color, #1A48EE); font-weight: bold; }
        .modal-body { font-size: 1.05rem; margin-bottom: 25px; line-height: 1.6; text-align: left; color: var(--color-gray, #4a5568); }

        /* Mobile Responsive Adjustments */
        @media (max-width: 600px) {
            h1 { font-size: 1.6rem; margin-top: 15px; }
            .game-btn { flex: 1 1 calc(50% - 10px); padding: 0.7rem 0.5rem; font-size: 0.9rem; text-align: center; }
            .game-btn.primary { flex: 1 1 100%; padding: 0.85rem 1rem; font-size: 1.05rem; }
            .game-card { padding: 1.25rem; margin-bottom: 1.25rem; }
            
            #turn-selection span { display: none; } /* Hide text to give buttons more space */
            
            .board-layout {
                grid-template-columns: 15px 1fr; /* Shrink margin for max board space */
                grid-template-rows: 15px 1fr;
                gap: 2px;
                margin-bottom: 1.5rem;
            }
            .col-labels { font-size: 0.75rem; }
            .row-labels { font-size: 0.75rem; padding-right: 3px; }
            
            #status { font-size: 1.1rem; }
            .info-title { font-size: 1.2rem; }
            .info-content { font-size: 0.95rem; }
        }