/* go.css — celikezor go oyunu stilleri */
/* Template: templates/data_manager/games/go.html'den çıkarıldı */

.game-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 2rem;
    padding: 4rem 1rem 1rem 1rem;
    min-height: calc(100vh - 120px);
}

.board-container {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
}

.info-wrapper {
    flex: 0.8;
    width: 100%;
}

.glass-card {
    background: rgba(10, 15, 25, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    box-sizing: border-box;
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.score-box {
    background: rgba(19, 34, 56, 0.3);
    border: 1px solid var(--surface-border);
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.score-box.active-player-black {
    border-color: var(--text-primary);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.score-box.active-player-white {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stone-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.stone-indicator.black {
    background: #000;
    border: 1px solid #fff;
}

.stone-indicator.white {
    background: #fff;
    border: 1px solid #000;
}

.score-val {
    font-size: 1.8rem;
    font-weight: 800;
}

.score-val.black-color {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.score-val.white-color {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* Game controls styling */
.control-group {
    margin-bottom: 1.2rem;
}

.control-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.control-buttons-row {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    flex: 1;
    background: rgba(19, 34, 56, 0.3);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    padding: 0.6rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    border-color: var(--accent-color);
    color: #ffffff;
}

.toggle-btn.active {
    background: var(--active-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.2);
}

.game-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.action-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(0, 210, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.action-btn.danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.action-btn.danger:hover {
    background: rgba(255, 51, 51, 0.1);
    box-shadow: 0 0 12px rgba(255, 51, 51, 0.3);
}

/* Sound and UI Bar */
.sound-toggle-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.sound-toggle-btn.muted {
    color: #ff3333;
    border-color: #ff3333;
}

/* Go Board Styling */
.go-board-wrapper {
    position: relative;
    width: 100%;
    max-width: 550px;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle, rgba(22, 38, 62, 0.8) 0%, rgba(10, 16, 27, 0.95) 100%);
    border: 2px solid var(--surface-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 210, 255, 0.1);
    box-sizing: border-box;
    overflow: hidden;
    touch-action: none;
}

.go-board-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.board-line {
    stroke: rgba(0, 210, 255, 0.35);
    stroke-width: 1.5;
    stroke-linecap: square;
}

.board-star {
    fill: var(--accent-color);
    filter: drop-shadow(0 0 3px rgba(0, 210, 255, 0.8));
}

/* Stones styling */
.stone {
    transition: all 0.15s ease-out;
    cursor: pointer;
}

.stone.black-stone {
    stroke: #ffffff;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.45)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.stone.white-stone {
    stroke: var(--accent-color);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 6px rgba(0, 210, 255, 0.45)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.stone.ghost-stone {
    pointer-events: none;
    transition: opacity 0.1s;
}

.stone.dead-stone {
    opacity: 0.35;
}

.dead-marker {
    pointer-events: none;
    stroke: var(--danger-color);
    stroke-width: 3.5;
    stroke-linecap: round;
}

/* Status Bar */
.game-status-bar {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.2rem;
    color: #ffffff;
    min-height: 1.8rem;
}

.game-status-bar span.turn-b {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.game-status-bar span.turn-w {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

.game-status-bar span.turn-scoring {
    color: var(--danger-color);
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

/* Custom Scoring Area Table */
.scoring-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.scoring-results-table th,
.scoring-results-table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

.scoring-results-table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.scoring-results-table tr.total-row {
    font-weight: bold;
    border-top: 2px solid var(--accent-color);
}

/* Alert popup */
.alert-popup {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 51, 51, 0.95);
    border: 2px solid var(--danger-color);
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.4);
    z-index: 10;
    display: none;
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Modal Overlay */
.game-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    /* Hide and prevent click interception when inactive */
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: rgba(10, 15, 25, 0.95);
    border: 1px solid var(--accent-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 210, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 85%;
}

.game-modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-title.black-win {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.modal-title.white-win {
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
}

.modal-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: #00b8e6;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

/* Mobile adjustments */
@media (max-width: 900px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
        gap: 1.5rem;
    }

    .board-container {
        flex: none;
        width: 100%;
        max-width: 500px;
    }

    .info-wrapper {
        flex: none;
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 576px) {
    .game-layout {
        padding: 1.5rem 0.5rem 0.5rem 0.5rem;
    }

    .go-board-wrapper {
        max-width: 90vw;
    }

    .glass-card {
        padding: 1rem;
    }

    .scoreboard {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
        margin-bottom: 1rem;
    }

    .score-box {
        padding: 0.5rem 0.25rem;
    }

    .score-label {
        font-size: 0.65rem;
        margin-bottom: 0.15rem;
    }

    .score-val {
        font-size: 1.3rem;
    }

    .control-group {
        margin-bottom: 1rem;
    }

    .control-label {
        font-size: 0.8rem;
        margin-bottom: 0.35rem;
    }

    .control-buttons-row {
        flex-direction: column;
        gap: 0.35rem;
    }

    .toggle-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .game-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .action-btn {
        width: 100%;
        padding: 0.7rem;
        font-size: 0.85rem;
    }

    .sound-toggle-btn {
        width: 100%;
        padding: 0.7rem;
    }

    .modal-card {
        padding: 1.5rem;
        max-width: 90%;
    }

    .modal-title {
        font-size: 1.6rem;
    }

    .modal-desc {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
}

/* ==================== RULES MODAL ==================== */

#rulesModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(5, 10, 18, 0.85) !important;
    backdrop-filter: blur(6px) !important;
    z-index: 250 !important;
    border-radius: 0 !important;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#rulesModal.show {
    display: flex !important;
}

.rules-card {
    background: rgba(10, 15, 25, 0.95) !important;
    border: 2px solid var(--accent-color) !important;
    border-radius: 16px !important;
    padding: 2rem !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 210, 255, 0.25) !important;
    max-width: 550px;
    width: 95%;
    text-align: left;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

#rulesModal.show .rules-card {
    transform: scale(1) !important;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.rules-header h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 700;
}

.close-rules-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-rules-btn:hover {
    color: #ffffff;
}

.rules-body {
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 1.5rem;
}

.rule-slide {
    display: none;
}

.rule-slide.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.rule-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.8rem;
}

.rule-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.rules-diagram {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.2rem 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.go-mini-board {
    display: flex;
    justify-content: center;
}

.rules-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rules-dots {
    display: flex;
    gap: 8px;
}

.rules-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface-border);
    cursor: pointer;
    transition: all 0.2s;
}

.rules-dot.active {
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
    transform: scale(1.2);
}

.rules-nav-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.rules-nav-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== FULLSCREEN MODE ==================== */

.game-layout:fullscreen {
    background: radial-gradient(circle at center, #0d1527 0%, #03060c 100%) !important;
    padding: 2rem 3rem !important;
    overflow-y: auto !important;
    min-height: 100vh !important;
    height: auto !important;
    width: 100vw !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3rem !important;
    box-sizing: border-box !important;
}

.game-layout:fullscreen .board-container {
    flex: 1.6 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.game-layout:fullscreen .go-board-wrapper {
    max-width: 80vh !important;
    max-height: 80vh !important;
    width: 80vh !important;
    aspect-ratio: 1 / 1 !important;
    border: 2px solid var(--surface-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 210, 255, 0.2) !important;
}

.game-layout:fullscreen .info-wrapper {
    flex: 0.7 !important;
    max-width: 380px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.game-layout:fullscreen .glass-card {
    background: rgba(10, 15, 25, 0.8) !important;
    border-color: rgba(0, 210, 255, 0.25) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
}

.game-layout:fullscreen .game-status-bar {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem !important;
}

/* Fullscreen responsive */
@media (max-width: 1024px) or (orientation: portrait) {
    .game-layout:fullscreen {
        flex-direction: column !important;
        padding: 1.5rem 1rem !important;
        overflow-y: auto !important;
        justify-content: flex-start !important;
        gap: 1.5rem !important;
    }

    .game-layout:fullscreen .board-container {
        flex: none !important;
        width: 100% !important;
        height: auto !important;
    }

    .game-layout:fullscreen .go-board-wrapper {
        width: 90vw !important;
        height: 90vw !important;
        max-height: 60vh !important;
    }

    .game-layout:fullscreen .info-wrapper {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}