
        :root {
            --bg-color: #0f172a;
            --card-bg: #1e293b;
            --info-bg: #334155;
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --accent-yellow: #eab308;
            --accent-cyan: #06b6d4;
            --accent-emerald: #10b981;
            --accent-red: #dc2626;
            --accent-red-hover: #b91c1c;
            --cell-default: #475569;
        }
        * { box-sizing: border-box; }
        /* デバッグ用body
        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            margin: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            min-height: 100vh;
        }*/

        .container {
            width: 100%;
            background-color: var(--card-bg);
            border-radius: 1rem;
            padding: 0.5rem;
            /*box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);*/
            border: 1px solid #334155;
        }
        .containerwrap{
            width: 100%;
            min-width: 300px;
            max-width: 500px;

        }
/*
        h1 {
            color: var(--accent-yellow);
            text-align: center;
            margin: 0 0 0.25rem 0;
            font-size: 1.5rem;
        }
*/
        .subtitle {
            text-align: center;
            color: var(--text-secondary);
            font-size: 0.875rem;
            margin-bottom: 1rem;
        }

        .status-panel {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .status-box {
            background-color: var(--info-bg);
            padding: 0.75rem;
            border-radius: 0.5rem;
            text-align: center;
            border-left: 4px solid transparent;
            font-size: 0.875rem;
            font-weight: 500;
			 color: var(--text-primary);
        }

        #info-box { border-left-color: var(--accent-yellow); transition: all 0.3s; }
        .af-counter { border-left-color: var(--accent-emerald); }

        .grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 2px;
            margin-bottom: 1.5rem;
        }

        .grid-cell {
            aspect-ratio: 1 / 1;
            background-color: var(--cell-default);
            border-radius: 0.25rem;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            user-select: none;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            min-width: 0; 
        }

        .placed-home {
            background-color: var(--accent-yellow) !important;
            border: 4px solid #fde047 !important;
        }

        .placed-af {
            background-color: var(--accent-cyan) !important;
            border: 4px solid #67e8f9 !important;
        }

        .valid-move {
            background-color: #334155;
            border: 2px dashed #94a3b8;
        }

        .valid-move:hover {
            background-color: #475569;
        }

        .preview-ll {
            opacity: 0.5;
            text-align: center;
        }

        .controls {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        .btn-group {
            display: flex;
            gap: 0.5rem;
            width: 100%;
        }

        button {
            flex: 1;
            padding: 0.6rem;
            border-radius: 0.5rem;
            border: none;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            color: white;
            transition: background-color 0.2s;
            min-width: 0; 
        }

        #undo-btn { background-color: #475569; }
        #undo-btn:hover:not(:disabled) { background-color: #64748b; }
        #undo-btn:disabled { opacity: 0.3; cursor: not-allowed; }

        #reset-btn { background-color: var(--accent-red); }
        #reset-btn:hover { background-color: var(--accent-red-hover); }

        #error-msg {
            color: #f87171;
            font-size: 0.75rem;
            height: 1rem;
            font-weight: bold;
        }

        .legend {
            margin-top: 1.5rem;
            padding: 1rem;
            background-color: rgba(15, 23, 42, 0.5);
            border-radius: 0.5rem;
            font-size: 0.75rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .legend-title {
            color: #cbd5e1;
            font-weight: bold;
            margin-bottom: 0.25rem;
        }

        .legend ul {
            margin: 0;
            padding-left: 1.25rem;
        }

        /* Adjust internal text sizes */
        .text-small { font-size: 0.6rem; opacity: 0.8; }
        .text-ll-label { font-size: 0.7rem; font-weight: bold; line-height: 1; }
        .text-ll-value { font-size: 1.1rem; font-weight: 900; line-height: 1; }
        .text-formula { font-size: 0.55rem; opacity: 0.7; }