@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Outfit:wght@300;400;600;700;900&display=swap');

:root {
    --game-red: #c62828;
    --game-green: #2e7d32;
    --game-blue: #1565c0;
    --game-orange: #ef6c00;
    --wood-dark: #3e2723;
    --wood-med: #5d4037;
    --wood-light: #8d6e63;
    --gold: #fdd835;
    --gold-light: #fff59d;
    --font-main: 'Outfit', sans-serif;
    --font-title: 'Cinzel', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #fff;
    overflow-x: hidden;
}

.istanbul-bg {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('logo.png'); /* Using logo as a placeholder or pattern for now, usually it's a scenic bg */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.cappadocia-bg {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('logo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* 3D Button Components */
.btn-3d {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    outline-offset: 4px;
    transition: filter 250ms;
    user-select: none;
    width: 100%;
}

.btn-3d-edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.btn-3d-front {
    display: block;
    position: relative;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    transform: translateY(-4px);
    transition: transform 600ms cubic-bezier(.3, .7, .4, 1);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-3d:hover {
    filter: brightness(110%);
}

.btn-3d:hover .btn-3d-front {
    transform: translateY(-6px);
    transition: transform 250ms cubic-bezier(.3, .7, .4, 1.5);
}

.btn-3d:active .btn-3d-front {
    transform: translateY(-2px);
    transition: transform 34ms;
}

/* Color Variants */
.btn-green .btn-3d-edge { background: linear-gradient(to left, #1b5e20 0%, #2e7d32 8%, #2e7d32 92%, #1b5e20 100%); }
.btn-green .btn-3d-front { background: #43a047; }

.btn-red .btn-3d-edge { background: linear-gradient(to left, #b71c1c 0%, #c62828 8%, #c62828 92%, #b71c1c 100%); }
.btn-red .btn-3d-front { background: #e53935; }

.btn-blue .btn-3d-edge { background: linear-gradient(to left, #0d47a1 0%, #1565c0 8%, #1565c0 92%, #0d47a1 100%); }
.btn-blue .btn-3d-front { background: #1e88e5; }

.btn-orange .btn-3d-edge { background: linear-gradient(to left, #e65100 0%, #ef6c00 8%, #ef6c00 92%, #e65100 100%); }
.btn-orange .btn-3d-front { background: #fb8c00; }

/* Wood Panel */
.wood-panel {
    background: linear-gradient(to bottom, #5d4037, #3e2723);
    border: 4px solid #8d6e63;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 2px 10px rgba(255,255,255,0.1);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.wood-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

/* Layout */
.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    z-index: 10;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-family: var(--font-title);
    font-size: 3.5rem;
    color: var(--gold);
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    letter-spacing: -2px;
}

.subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: rgba(255,255,255,0.6);
    margin-top: -5px;
}

/* Auth Pages */
.auth-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--gold-light);
}

.form-input {
    width: 100%;
    background: #1a130f;
    border: 2px solid #4e342e;
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: var(--font-main);
    transition: border-color 0.2s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
}

/* Profile / Dashboard */
.stat-chips {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-chip {
    background: rgba(0,0,0,0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    flex: 1;
}

.stat-chip span:first-child {
    display: block;
    font-size: 0.6rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2px;
}

.stat-chip span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
}

.store-links-container {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.store-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.store-badge img {
    height: 40px;
    transition: transform 0.2s;
}

.store-badge:hover img {
    transform: scale(1.05);
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    z-index: 10;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.footer-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #fff;
}

/* Toasts */
#toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

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

#toast.error { border: 2px solid var(--game-red); color: #ffcdd2; background: #311b1b; }
#toast.success { border: 2px solid var(--game-green); color: #c8e6c9; background: #1b2e1b; }

/* Admin Dashboard Specifics */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0.75rem;
}

.leaderboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #334155;
    font-size: 0.9rem;
}

.leaderboard-table tr:hover {
    background: rgba(255,255,255,0.05);
}
