:root {
    --bg-color: #0f172a;
    --bg-gradient: radial-gradient(circle at top right, #121820, #0f172a);
    --primary-color: #06b6d4;
    /* Cyan */
    --secondary-color: #8b5cf6;
    /* Violet */
    --accent-color: #f43f5e;
    /* Rose for errors/enemy */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #00d4ff;
    --secondary-color: #ff00ff;
    --accentt-color: #ffdd00;
    --board-size: 600px;
    --cell-count: 15;
    --cell-size: calc(var(--board-size) / var(--cell-count));

    --piece-black: #1e293b;
    --piece-black-glow: 0 0 10px rgba(0, 0, 0, 0.5);
    --piece-white: #f1f5f9;
    --piece-white-glow: 0 0 15px rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.home{
    position: fixed;
    right: 18px;
    top: 10px;
    color: #b3b3b3;
    text-decoration: none;
    font-size: 1rem;
}
.home:hover{
    color: white;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    align-items: center;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: fit-content;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}
.title-glow {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accentt-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px var(--primary-color));
    animation: titlePulse 3s ease-in-out infinite;
}
.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 8px;
    color: var(--primary-color);
    opacity: 0.8;
    text-transform: uppercase;
}

.game-layout {
    display: flex;
    gap: 30px;
    flex: 1;
    justify-content: center;
    align-items: flex-start;
}

/* Glass Panel Styles */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.controls-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.panel-section h2,
.panel-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toggle Switch & Radio Buttons */
.toggle-switch,
.color-choice {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
}

.toggle-switch input,
.color-choice input {
    display: none;
}

.toggle-switch label,
.color-choice label {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toggle-switch input:checked+label,
.color-choice input:checked+label {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.color-btn .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.black-btn .dot {
    background: #000;
    border: 1px solid #444;
}

.white-btn .dot {
    background: #fff;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.home-btn{
    margin-top:10px;
}
.home-btn a{
    color:white;
        text-decoration: none;
}
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Status Section */
.turn-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.turn-badge .icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 10px var(--text-muted);
    transition: all 0.3s ease;
}

.turn-badge.player-turn .icon {
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.turn-badge.computer-turn .icon {
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

.win-message {
    margin-top: 20px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.win-message.hidden {
    display: none;
}

.win-message h2 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    border: none;
}

/* Board Styles */
.board-container {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-board {
    width: var(--board-size);
    height: var(--board-size);
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 18px;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Grid Lines */
.game-board::before {
    content: '';
    position: absolute;
    top: calc(var(--cell-size) / 2);
    left: calc(var(--cell-size) / 2);
    right: calc(var(--cell-size) / 2);
    bottom: calc(var(--cell-size) / 2);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: var(--cell-size) var(--cell-size);
    pointer-events: none;
    z-index: 0;
}

/* Intersection Dots (Star points) */
.star-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.cell {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    cursor: url(./hand.cur),pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell:hover::after {
    content: '';
    width: 40%;
    height: 40%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.piece {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    position: absolute;
    transform: scale(0);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #475569, #020617);
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1), 0 2px 5px rgba(0, 0, 0, 0.5);
}

.piece.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #cbd5e1);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.3);
}

.piece.last-move::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    opacity: 0.8;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes titlePulse {

    0%,
    100% {
        filter: drop-shadow(0 0 30px var(--primary-color));
    }

    50% {
        filter: drop-shadow(0 0 50px var(--secondary-color));
    }
}
/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.modal-header {
    margin-bottom: 30px;
}

.result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.result-icon.defeat {
    background: linear-gradient(135deg, var(--accent-color), #dc2626);
    box-shadow: 0 10px 30px rgba(244, 63, 94, 0.4);
}

.icon-trophy {
    width: 50px;
    height: 50px;
    color: white;
    stroke-width: 2.5;
}

#modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#modal-message {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.modal-btn:active {
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 900px) {
    html, body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    .app-container::-webkit-scrollbar,
    .game-layout::-webkit-scrollbar,
    .controls-panel::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
    body {
        align-items: flex-start;
        min-height: 100dvh;
    }
    .title-glow {
        font-size:2.5rem;
    }
    .game-layout {
        flex-direction: column-reverse;
        align-items: center;
    }

    .controls-panel {
        width: 100%;
        max-width: var(--board-size);
        gap: 20px;
    }

    .controls-panel.glass-panel {
        padding: 16px;
        border-radius: 20px;
    }

    .panel-section h2,
    .panel-section h3 {
        font-size: 1rem;
    }

    .control-group label {
        font-size: 0.85rem;
    }

    .toggle-switch label,
    .color-choice label {
        padding: 8px;
        font-size: 0.85rem;
    }

    .primary-btn {
        padding: 12px;
        font-size: 0.9rem;
    }

    .turn-badge {
        padding: 10px;
    }

    .turn-badge .icon {
        width: 14px;
        height: 14px;
    }

    .app-container {
        height: auto;
        padding: 12px;
    }

    .board-container {
        padding: 0;
    }

    :root {
        --board-size: calc(100vw - 24px);
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal {
        width: 100dvw;
        height: 100dvh;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}
