/* Fametown Games - Common Styles (Glassmorphism) */
* {
    box-sizing: border-box;
}

:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #ff0080;
    --text-color: #ffffff;
    --bg-color: #0f0c29;
    /* Fallback */
    --font-main: 'Inter', 'Roboto', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Top Bar --- */
.ft-top-bar-wrapper {
    width: 100%;
    background: rgba(15, 12, 41, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.ft-top-bar {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    box-sizing: border-box;
    z-index: 100;
}

.ft-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ft-home-btn,
.ft-back-btn {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-home-btn:hover,
.ft-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.ft-stats-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ft-score-display {
    font-size: 1rem;
    font-weight: 700;
    background: var(--primary-gradient);
    padding: 6px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-score-value {
    font-size: 1.1rem;
}

.ft-stats-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ft-stats-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Stats Panel (Overlay) --- */
.ft-stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ft-stats-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ft-stats-panel {
    background: rgba(30, 30, 50, 0.9);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 30px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.ft-stats-overlay.active .ft-stats-panel {
    transform: translateY(0);
}

.ft-close-stats {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.ft-close-stats:hover {
    color: #fff;
}

.ft-stats-title {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    text-align: center;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ft-stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ft-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ft-stat-item:last-child {
    border-bottom: none;
}

.ft-stat-name {
    font-weight: 500;
    color: #ddd;
}

.ft-stat-value {
    font-weight: 700;
    color: #fff;
}

/* --- Common Game Container --- */
.game-container {
    margin-top: 20px;
    /* Adjusted for static header */
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Glassmorphism Utilities --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 20px;
}

.glass-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.glass-btn:active {
    transform: translateY(0);
}

.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.glass-input:focus {
    border-color: rgba(118, 75, 162, 0.8);
}

/* --- Typography --- */
h1,
h2,
h3 {
    margin-top: 0;
    color: #fff;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .ft-top-bar {
        padding: 10px 15px;
    }

    .ft-brand span {
        display: none;
        /* Hide text on small screens if needed */
    }

    .ft-home-btn,
    .ft-back-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.8rem;
    }
}

/* --- Victory Message Modal --- */
#victoryMessage {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 12, 41, 0.95);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

#victoryMessage h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#victoryMessage p {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ddd;
}