:root {
    --bg-main: #0f1115;
    --bg-secondary: rgba(26, 29, 36, 0.8);
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    
    /* DiceTower Colors */
    --accent-red: #e63946;
    --accent-red-hover: #ff4d5a;
    --accent-gold: #f4a261;
    --accent-gold-hover: #e7cbb1;
    
    --border-glass: rgba(255, 255, 255, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(230, 57, 70, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(244, 162, 97, 0.08), transparent 25%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.hidden {
    display: none !important;
}

/* Typography elements */
h1 { font-weight: 900; font-size: 2.5rem; letter-spacing: -1px; }
h2 { font-weight: 700; font-size: 1.8rem; margin-bottom: 1rem; color: var(--text-main); }
.accent-red { color: var(--accent-red); }
.accent-gold { color: var(--accent-gold); }

/* Header */
.hero-glass {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glass);
}
.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    font-weight: 300;
}

/* --- Base Styles --- */
.music-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    border-radius: 30px;
    padding: 10px 20px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.music-toggle-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    transform: scale(1.05);
}
.music-toggle-btn.playing {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.top-banner {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background-color: #111; /* Fills in any empty space on ultra-wide screens */
    display: block;
    border-bottom: 2px solid var(--accent-gold);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
    .top-banner {
        height: 150px;
    }
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glass);
}

/* Forms and Inputs */
input[type="text"], input[type="datetime-local"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}
input[type="text"]:focus, input[type="url"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus, .custom-select:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2);
}

.custom-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
}
.custom-select option {
    background: var(--bg-main);
    color: white;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-primary {
    background: var(--accent-red);
    color: white;
    padding: 0.8rem 1.5rem;
}
.btn-primary:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem 1.5rem;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Search Area */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    align-items: center;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-gold);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Search Results Dropdown-style */
.bgg-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(10, 12, 16, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.5rem;
}
.bgg-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.bgg-result-item:hover {
    background: rgba(255,255,255,0.05);
}
.bgg-result-item img {
    height: 50px;
    width: 50px;
    object-fit: cover;
    border-radius: 4px;
}
.bgg-result-item .bgg-result-info h4 {
    margin-bottom: 0.2rem;
    color: var(--accent-gold);
}
.bgg-result-item .bgg-result-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Games Grid & Calendar Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.calendar-grid {
    width: 100%;
}
.calendar-grid::-webkit-scrollbar {
    height: 10px;
}
.calendar-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

/* Game Card */
.game-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.2);
}
.game-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-glass);
}
.game-info {
    padding: 1.5rem;
    flex: 1;
}
.game-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.game-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-weight: 600;
}
.game-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    transition: color 0.2s;
}
.game-desc:hover {
    color: var(--text-main);
}
.game-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Signups Section inside Card */
.signups-section {
    border-top: 1px dashed var(--border-glass);
    padding-top: 1rem;
    margin-bottom: 1rem;
}
.signups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.signups-header strong { color: white; }
.signup-list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.signup-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.signup-item:last-child {
    border-bottom: none;
}
.signup-time {
    color: var(--accent-gold);
    font-size: 0.8rem;
}

/* Card Actions */
.game-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.game-actions button {
    width: 100%;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    max-height: 90vh;
    overflow-y: auto;
}
/* Style the scrollbar inside the modal for a premium feel */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.optional-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}
.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}
