        :root {
            --board-color: #e3bc7a;
            --line-color: #444;
            --container-bg: #1e1e1e;
            --accent-color: #3498db;
            --danger-color: #e74c3c;
            --text-primary: #e0e0e0;
            --text-secondary: #a0a0a0;
        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }



        .game-main-wrapper {
        margin-left: auto;
        margin-right: auto;
            background: #2c3e50;
            border: 4px solid #3f8fef;
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        width: 100%;
        max-width: 800px;
        text-align: center;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-primary);
        }

        .scoreboard {
            display: flex;
            width: 100%;
            gap: 10px;
            margin-bottom: 15px;
            justify-content: center;
            align-items: center;
        }

        .score-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            background: rgba(255, 255, 255, 0.05);
            padding: 8px;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .score-label {
            font-size: 0.65rem;
            color: var(--text-secondary);
            margin-bottom: 3px;
            text-align: center;
        }

        .score-number {
            font-size: 1.4rem;
            font-weight: 800;
        }

        .game-info {
            width: 100%;
            text-align: center;
            margin-bottom: 15px;
        }

        .status {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 10px;
            padding: 6px 20px;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.08);
            display: inline-block;
            min-height: 35px;
        }

        .win-msg { color: #2ecc71; animation: pulse 1.5s infinite; }
        .error-msg { color: var(--danger-color); }

        .controls {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }

        .row {
            display: flex;
            gap: 6px;
            justify-content: center;
        }

        #game-container {
            position: relative;
            background: var(--board-color);
            border-radius: 4px;
            box-shadow: inset 0 0 30px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.4);
            line-height: 0;
            width: 100%;
            aspect-ratio: 1 / 1;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }

        canvas {
            cursor: pointer;
            touch-action: none;
        }

        .btn {
            padding: 0px 0px 8px 0px;
            font-size: 1.0rem;
            background: #333;
            color: var(--text-primary);
            border: 1px solid #444;
            border-radius: 6px;
            cursor: pointer;
            flex: 1;
            transition: all 0.2s;
        }

        .btn.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
        .btn.toggle-active { background: #27ae60; border-color: #2ecc71; }
        
        .reset-btn {
            background: #c0392b; 
            border: none;
            font-weight: bold;
            margin-top: 4px;
        }

      .sangdan{ 
display: flex; /* 필수: Flexbox 레이아웃 시작 */
    justify-content: center; /* 가로축(메인축) 중앙 정렬 */
    align-items: center; /* 세로축(교차축) 중앙 정렬 */
       }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }