/* TRON Light Cycle Game Styles - Fullscreen Layout */
#tron-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: #000;
    overflow: hidden;
    z-index: 10000;
}

/* TRON Light Cycle Game Styles - Scoped to #tron-container */
#tron-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #001122 0%, #000 70%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#tron-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.tron-back-bar {
    background: #000;
    padding: 1rem;
    border-bottom: 1px solid #00f0ff;
    box-shadow: 0 2px 10px rgba(0, 240, 255, 0.3);
    z-index: 10000;
}

#tron-back-btn {
    background-color: #b5904c;
    color: #1c1c1c;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

#tron-back-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

#tron-back-btn:active {
    transform: translateY(0);
}

.game-area {
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    border: none;
    box-shadow: none;
}

/* Game elements */
.light-cycle {
    position: absolute;
    background-color: #00f0ff;
    box-shadow: 0 0 10px #00f0ff, inset 0 0 5px #00cc99;
    border: 1px solid #00f0ff;
}

.ai-light-cycle {
    position: absolute;
    background-color: #ff0066;
    box-shadow: 0 0 10px #ff0066, inset 0 0 5px #ff3377;
    border: 1px solid #ff0066;
}

.light-trail {
    position: absolute;
    background-color: #00f0ff;
    opacity: 0.6;
    border: 1px solid #00f0ff;
}

.ai-light-trail {
    position: absolute;
    background-color: #ff0066;
    opacity: 0.6;
    border: 1px solid #ff0066;
}

.wall {
    position: absolute;
}

.wall.border {
    background: linear-gradient(45deg, #00f0ff, #00cc99, #00f0ff);
    border: none;
    box-shadow: 0 0 5px #00f0ff, inset 0 0 3px #00f0ff;
}

.wall.barrier {
    background-color: #005666;
    border: 1px solid #00f0ff;
    box-shadow: 0 0 3px #00f0ff;
}

/* Game UI */
.game-ui {
    position: absolute;
    color: #00f0ff;
    font-family: 'Courier New', monospace;
    z-index: 100;
}

.score-display {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
}

.instructions {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #00f0ff;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #00f0ff;
    border-radius: 10px;
    padding: 40px;
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.8),
        inset 0 0 20px rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.game-over h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00f0ff;
}

.game-over h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #00cc99;
}

.game-over p {
    font-size: 16px;
    margin-bottom: 10px;
    color: #00cc99;
}

/* Flash animation for game over */
@keyframes flash {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

.flash {
    animation: flash 0.5s infinite;
}

/* Cycle destroyed/shatter effect */
@keyframes shatter {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    25% {
        transform: translate(var(--x-mid), var(--y-mid)) scale(0.8) rotate(var(--rotation-mid));
        opacity: 0.9;
    }

    100% {
        transform: translate(var(--x-final), var(--y-final)) scale(0.1) rotate(var(--rotation-final));
        opacity: 0;
    }
}

@keyframes shatterSpark {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(var(--spark-x), var(--spark-y)) scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(var(--spark-x-final), var(--spark-y-final)) scale(0);
        opacity: 0;
    }
}

.shatter-fragment {
    position: absolute;
    background-color: inherit;
    box-shadow: inherit;
    border: inherit;
    animation: shatter 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 1001;
}

.shatter-spark {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    animation: shatterSpark 0.8s ease-out forwards;
    z-index: 1002;
}

/* Responsive design */
@media (max-width: 768px) {
    .score-display {
        font-size: 16px;
    }

    .instructions {
        font-size: 12px;
    }

    .game-over h1 {
        font-size: 36px;
    }

    .game-over h2 {
        font-size: 20px;
    }

    .game-over p {
        font-size: 14px;
    }
}