/* ==== Seite: tictactoe ==== */

/* Reset der globalen Karten-Komponente für den Spiel-Container */

/* Main Card */

body.page-tictactoe .card-header {

            text-align: center;
            margin-bottom: 40px;
        
}

body.page-tictactoe .card-header h1 {

            font-family: 'Press Start 2P', monospace;
            font-size: 1.9em;
            letter-spacing: 2px;
            color: #ff3b5c;
            margin-bottom: 12px;
            text-shadow: 0 0 12px rgba(255, 59, 92, 0.6), 0 0 32px rgba(255, 59, 92, 0.3), 3px 3px 0 #111;
        
}

body.page-tictactoe .card-header h1 i {

            display: inline-block;
            transform: translateY(-8px);
        
}

body.page-tictactoe .card-header p {

            color: var(--c-muted);
            font-size: 1.1em;
        
}

/* Mode Selection */

body.page-tictactoe .mode-selection {

            display: flex;
            gap: 4px;
            justify-content: center;
            margin-bottom: 10px;
            flex-wrap: wrap;
            background: linear-gradient(135deg, #f0f3ff 0%, #f8f9ff 100%);
            padding: 5px;
            border-radius: 50px;
            border: 1px solid var(--c-border);
            width: fit-content;
            margin-left: auto;
            margin-right: auto;
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.10);
        
}

body.page-tictactoe .mode-btn {

            padding: 8px 18px;
            background: transparent;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            color: #5a5a6e;
            transition: all 0.3s;
        
}

body.page-tictactoe .mode-btn:hover {

            color: var(--c-accent);
        
}

body.page-tictactoe .mode-btn.active {

            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        
}

/* Feldgröße + Schwierigkeit (klassisches Spiel) – gleicher Stil wie die Controls */
body.page-tictactoe #tttOptions.controls {
    gap: 6px;
    padding: 5px 8px;
}
body.page-tictactoe #tttOptions.controls .control-btn {
    width: auto;
    padding: 0 14px;
    font-size: 13px;
}
body.page-tictactoe #tttOptions.controls .control-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
body.page-tictactoe #tttOptions .ttt-opt {
    display: flex;
    align-items: center;
    gap: 4px;
}
body.page-tictactoe #tttOptions .ttt-opt + .ttt-opt {
    border-left: 1px solid rgba(102, 126, 234, 0.2);
    margin-left: 6px;
    padding-left: 10px;
}
body.page-tictactoe #tttOptions .ttt-opt-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-muted);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
body.dark-theme.page-tictactoe #tttOptions .ttt-opt-label {
    color: #9a9aaa;
}

/* Boardgrößen: Zellengrößen anpassen */
body.page-tictactoe .game-board.board-size-3 .cell { width: 100px; height: 100px; font-size: 48px; }
body.page-tictactoe .game-board.board-size-4 .cell { width: 76px; height: 76px; font-size: 34px; }
body.page-tictactoe .game-board.board-size-5 .cell { width: 60px; height: 60px; font-size: 26px; }
body.page-tictactoe .game-board.board-size-4 { max-width: 350px; }
body.page-tictactoe .game-board.board-size-5 { max-width: 350px; }

/* Game Board */

body.page-tictactoe .game-container {

            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 30px;
            margin-top: 30px;
        
}

body.page-tictactoe .game-board {

            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        
}

body.page-tictactoe .cell {

            width: 100px;
            height: 100px;
            background: var(--c-surface-2);
            border: 3px solid #667eea;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
        
}

body.page-tictactoe .cell:hover:not(.taken) {

            background: var(--c-surface-2);
            transform: scale(1.05);
        
}

body.page-tictactoe .cell.taken {

            cursor: not-allowed;
        
}

body.page-tictactoe .cell.x {

            color: var(--c-accent);
        
}

body.page-tictactoe .cell.o {

            color: var(--c-accent-2);
        
}

body.page-tictactoe .cell.winner {

            background: #10b981;
            color: white;
            animation: pulse 0.5s ease-in-out;
        
}

@keyframes pulse {

            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        
}

/* Super Tic-Tac-Toe */

body.page-tictactoe .ultimate-board {

            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            background: #c9c9d6;
            padding: 8px;
            border-radius: 12px;
            max-width: 520px;
            margin: 30px auto 30px;
            box-sizing: border-box;
            box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        
}

body.page-tictactoe .local-board {

            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            background: var(--c-surface-2);
            padding: 6px;
            border-radius: 8px;
            position: relative;
            transition: transform 0.25s ease, box-shadow 0.25s ease;
        
}

body.page-tictactoe .local-board.active {

            box-shadow: 0 0 0 3px #8b5cf6;
            background: #ddd7f7;
            z-index: 2;
        
}

body.page-tictactoe .local-board.won-x::after, body.page-tictactoe .local-board.won-o::after, body.page-tictactoe .local-board.tie::after {

            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.2rem;
            font-weight: bold;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.85);
            z-index: 3;
        
}

body.page-tictactoe .local-board.won-x::after {
 content: 'X'; color: var(--c-accent); 
}

body.page-tictactoe .local-board.won-o::after {
 content: 'O'; color: var(--c-accent-2); 
}

body.page-tictactoe .local-board.tie::after {
 content: '-'; color: #94a3b8; font-size: 1.8rem; 
}

body.page-tictactoe .ultimate-board .cell {

            width: auto;
            height: auto;
            aspect-ratio: 1 / 1;
            min-height: 38px;
            background: var(--c-surface-2);
            border: 2px solid #c9c9d6;
            border-radius: 6px;
            font-size: 1.3rem;
            padding: 0;
        
}

body.page-tictactoe .ultimate-board .cell:hover:not(:disabled) {

            background: var(--c-surface-2);
            transform: none;
        
}

body.page-tictactoe .ultimate-board .cell:disabled {

            cursor: not-allowed;
            opacity: 0.6;
        
}

body.page-tictactoe .ultimate-board .cell.x {
 color: var(--c-accent); 
}

body.page-tictactoe .ultimate-board .cell.o {
 color: var(--c-accent-2); 
}

/* Gewonnene Mini-Bretter: Animation */

body.page-tictactoe .local-board.winner-board {

            animation: winBoardPulse 0.8s ease-in-out infinite;
        
}

@keyframes winBoardPulse {

            0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
            50% { transform: scale(1.07); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.7); }
        
}

/* Undo-Button: deaktivierter Zustand */

body.page-tictactoe #undoBtn:disabled {

            background: var(--c-surface-2);
            color: #a0a0b0;
            border: 1px dashed #c0c0d0;
            box-shadow: none;
            transform: none;
            cursor: not-allowed;
            opacity: 1;
        
}

body.dark-theme.page-tictactoe #undoBtn:disabled {

            background: var(--c-surface);
            color: var(--c-muted);
            border-color: var(--c-border);
        
}

@media (max-width: 600px) {
body.page-tictactoe .local-board:not(.active) {
 opacity: 0.5; 
}
body.page-tictactoe .local-board.active {
 opacity: 1; transform: scale(1.03); 
}
body.page-tictactoe .ultimate-board {
 max-width: 100%; 
}
}

/* Game Status */

body.page-tictactoe .game-status {

            text-align: center;
            font-size: 1.15em;
            font-weight: 600;
            color: #3a3a4c;
            margin-bottom: 20px;
            padding: 16px 20px;
            background: linear-gradient(135deg, #f0f3ff 0%, #f8f9ff 100%);
            border: 1px solid var(--c-border);
            border-radius: 14px;
        
}

body.page-tictactoe .game-status.win {

            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border-color: transparent;
            color: white;
        
}

body.page-tictactoe .game-status.lose {

            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            border-color: transparent;
            color: white;
        
}

body.page-tictactoe .game-status.draw {

            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            border-color: transparent;
            color: white;
        
}

/* Controls */

body.page-tictactoe .controls {

            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
        
}

body.page-tictactoe .btn {

            padding: 12px 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        
}

body.page-tictactoe .btn:hover {

            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        
}

body.page-tictactoe .btn:disabled {

            background: #ccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        
}

body.page-tictactoe #musicToggle {

            text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
        
}

/* Score Board */

body.page-tictactoe .score-board {

            display: flex;
            justify-content: space-around;
            margin-bottom: 20px;
            padding: 22px 20px;
            background: linear-gradient(135deg, #f0f3ff 0%, #f8f9ff 100%);
            border: 1px solid var(--c-border);
            border-radius: 16px;
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.10);
            flex-wrap: wrap;
            gap: 10px;
        
}

body.page-tictactoe .score-item {

            text-align: center;
        
}

body.page-tictactoe .score-label {

            font-size: 13px;
            font-weight: 600;
            color: var(--c-muted);
            text-transform: uppercase;
            letter-spacing: 0.6px;
            margin-bottom: 6px;
        
}

body.page-tictactoe .score-value {

            font-family: 'Press Start 2P', monospace;
            font-size: 1.4em;
            letter-spacing: 1px;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        
}

body.page-tictactoe .score-yellow {
 color: #ffe100; text-shadow: 0 0 10px rgba(255, 225, 0, 0.55); 
}

body.page-tictactoe .score-cyan {
 color: #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.55); 
}

body.page-tictactoe .score-magenta {
 color: #ff4fd8; text-shadow: 0 0 10px rgba(255, 79, 216, 0.55); 
}

body.page-tictactoe .score-green {
 color: #39ff14; text-shadow: 0 0 10px rgba(57, 255, 20, 0.55); 
}

/* Info Section */

body.page-tictactoe .info-icon {

            font-size: 24px;
        
}

body.page-tictactoe .info-text {

            flex: 1;
            font-size: 14px;
            color: var(--c-accent);
            font-weight: 600;
        
}

/* SEO Section */

/* Back to Top Button */

/* Responsive */

@media (max-width: 768px) {
body.page-tictactoe .card-header h1 {

                font-size: 1.4em;
            
}
body.page-tictactoe .cell {

                width: 80px;
                height: 80px;
                font-size: 36px;
            
}
/* Smaller buttons on mobile */
body.page-tictactoe .controls {

                gap: 8px;
            
}
body.page-tictactoe .btn {

                padding: 10px 18px;
                font-size: 14px;
                border-radius: 10px;
            
}
}

/* Dark Theme */

body.dark-theme.page-tictactoe .card-header h1 {

            color: #ff3b5c;
            text-shadow: 0 0 12px rgba(255, 59, 92, 0.6), 0 0 32px rgba(255, 59, 92, 0.3), 3px 3px 0 #111;
        
}

body.dark-theme.page-tictactoe .card-header p {

            color: var(--c-muted);
        
}

body.dark-theme.page-tictactoe .mode-selection {

            background: none;
            border-color: var(--c-border);
        
}

body.dark-theme.page-tictactoe .mode-btn {

            color: var(--c-muted);
        
}

body.dark-theme.page-tictactoe .mode-btn:hover {

            color: var(--c-accent);
        
}

body.dark-theme.page-tictactoe .cell {

            background: var(--c-surface);
            border-color: var(--c-accent);
        
}

body.dark-theme.page-tictactoe .cell:hover:not(.taken) {

            background: var(--c-surface-2);
        
}

body.dark-theme.page-tictactoe .ultimate-board {

            background: #334155;
        
}

body.dark-theme.page-tictactoe .local-board {

            background: var(--c-surface);
        
}

body.dark-theme.page-tictactoe .local-board.active {

            background: #24334d;
        
}

body.dark-theme.page-tictactoe .ultimate-board .cell {

            background: #1e1e2e;
            border-color: #334155;
        
}

body.dark-theme.page-tictactoe .ultimate-board .cell:hover:not(:disabled) {

            background: var(--c-surface-2);
        
}

body.dark-theme.page-tictactoe .local-board.won-x::after, body.dark-theme.page-tictactoe .local-board.won-o::after, body.dark-theme.page-tictactoe .local-board.tie::after {

            background: rgba(15, 23, 42, 0.85);
        
}

body.dark-theme.page-tictactoe .game-status {

            background: none;
            border-color: var(--c-border);
            box-shadow:  0 6px 20px rgba(102, 126, 234, 0.10);
            color: #e0e0e0;
        
}

body.dark-theme.page-tictactoe .score-board {

            background: none;
            border-color: var(--c-border);
        
}

body.dark-theme.page-tictactoe .score-label {

            color: #9a9ab0;
        
}

body.dark-theme.page-tictactoe .score-value {

            background: linear-gradient(135deg, #8b9cf7 0%, #a78bfa 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        
}

body.dark-theme.page-tictactoe .score-yellow {
 color: #ffe100; text-shadow: 0 0 10px rgba(255, 225, 0, 0.55); 
}

body.dark-theme.page-tictactoe .score-cyan {
 color: #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.55); 
}

body.dark-theme.page-tictactoe .score-magenta {
 color: #ff4fd8; text-shadow: 0 0 10px rgba(255, 79, 216, 0.55); 
}

body.dark-theme.page-tictactoe .score-green {
 color: #39ff14; text-shadow: 0 0 10px rgba(57, 255, 20, 0.55); 
}

body.dark-theme.page-tictactoe .info-text {

            color: var(--c-accent);
        
}

/* Hidden class for search filtering */
