/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    --bg-color: #0b061e;
    --bg-gradient: radial-gradient(circle at top, #24145c 0%, #0b061e 100%);
    --card-bg: rgba(30, 20, 62, 0.65);
    --card-border: rgba(243, 198, 35, 0.12);
    --card-border-glow: rgba(243, 198, 35, 0.4);
    --gold: #f3c623;
    --gold-dark: #d89f0e;
    --gold-glow: rgba(243, 198, 35, 0.3);
    --text-color: #f5f3f7;
    --text-muted: #9f9aa7;
    --success: #2ecc71;
    --error: #e74c3c;
    --header-font: 'Outfit', sans-serif;
    --body-font: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    color: var(--text-color);
    font-family: var(--body-font);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

/* Layout Utilities */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 75px; /* space for tab bar */
}

.scoreboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Glass Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--card-border-glow);
    box-shadow: 0 8px 32px 0 var(--gold-glow);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--header-font);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.title-gold {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(243, 198, 35, 0.3);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    color: #0b061e;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(243, 198, 35, 0.3);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 198, 35, 0.5);
    filter: brightness(1.1);
}

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

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
    filter: grayscale(0.8);
    transform: none !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    color: white;
    font-family: var(--body-font);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(243, 198, 35, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.form-control:disabled,
.form-control[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Header Action Buttons (Touch-friendly 42x42px) */
.header-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.header-icon-btn:hover {
    background: rgba(243, 198, 35, 0.18);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 0 12px var(--gold-glow);
}

.header-icon-btn:active {
    transform: scale(0.90);
    background: rgba(243, 198, 35, 0.25);
}

.header-photo-btn {
    background: linear-gradient(135deg, rgba(243, 198, 35, 0.22) 0%, rgba(243, 198, 35, 0.08) 100%);
    border: 1px solid rgba(243, 198, 35, 0.45);
    color: var(--gold);
    box-shadow: 0 0 10px rgba(243, 198, 35, 0.2);
}

.header-photo-btn:hover {
    background: linear-gradient(135deg, rgba(243, 198, 35, 0.4) 0%, rgba(243, 198, 35, 0.15) 100%);
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 0 15px var(--gold-glow);
}

.header-logout-btn {
    color: var(--text-muted);
}

.header-logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.5);
    color: var(--error);
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.4);
}

/* PWA Navigation Tabs */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(18, 10, 48, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(243, 198, 35, 0.15);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--body-font);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    color: var(--gold);
}

.tab-btn.active svg {
    filter: drop-shadow(0 0 6px var(--gold-glow));
    stroke: var(--gold);
}

.tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Costume Guessing Game UI */
.guess-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.guess-row:last-child {
    border-bottom: none;
}

.guess-user {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guess-user span.guessed-badge {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 12px;
    text-transform: uppercase;
}

.guess-input-group {
    display: flex;
    gap: 8px;
    width: 60%;
}

.guess-input-group input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.revealed-costume {
    font-size: 0.9rem;
    color: var(--success);
    font-style: italic;
    background: rgba(46, 204, 113, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px dashed rgba(46, 204, 113, 0.3);
}

/* Activities Grid */
.activities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 480px) {
    .activities-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.activity-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.activity-card:hover {
    border-color: rgba(243, 198, 35, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.activity-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.activity-points {
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.activity-actions {
    display: flex;
    gap: 8px;
}

.activity-actions button {
    flex: 1;
}

/* Duck Hunt Dashboard Widget */
.duck-counter-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
}

.duck-display {
    text-align: center;
}

.duck-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold);
    font-family: var(--header-font);
    line-height: 1;
    margin-bottom: 4px;
}

.duck-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Leaderboard Page (Projector Theme) */
.scoreboard-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.scoreboard-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (min-width: 800px) {
    .scoreboard-columns {
        grid-template-columns: 1fr 1fr;
    }
}

/* Podium Design */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 15px;
    height: 180px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(243, 198, 35, 0.1);
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 110px;
    transition: var(--transition);
}

.podium-place .avatar-container {
    position: relative;
    margin-bottom: 10px;
}

.podium-place .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    border: 3px solid #ccc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.podium-place.first .avatar {
    width: 75px;
    height: 75px;
    font-size: 1.5rem;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    background: radial-gradient(circle, #ffd700 0%, #b8860b 100%);
    color: #12092f;
}

.podium-place.second .avatar {
    border-color: #c0c0c0;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.4);
    background: radial-gradient(circle, #c0c0c0 0%, #7f8c8d 100%);
    color: #12092f;
}

.podium-place.third .avatar {
    border-color: #cd7f32;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.4);
    background: radial-gradient(circle, #cd7f32 0%, #8e44ad 100%);
    color: #ffffff;
}

.podium-crown {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-10deg);
    font-size: 1.4rem;
}

.podium-place .pedestal {
    width: 100%;
    min-width: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding: 4px 6px;
    box-sizing: border-box;
}

.podium-place.first .pedestal {
    height: 78px;
    border-color: rgba(255, 215, 0, 0.3);
}

.podium-place.second .pedestal {
    height: 60px;
    border-color: rgba(192, 192, 192, 0.25);
}

.podium-place.third .pedestal {
    height: 48px;
    border-color: rgba(205, 127, 50, 0.2);
}

.podium-name {
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.2;
    color: #fff;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
    display: block;
    margin-bottom: 2px;
    padding: 0 2px;
    box-sizing: border-box;
}

.podium-score {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.2;
    color: var(--gold);
}

/* Scoreboard List */
.score-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 15px;
    border-radius: 10px;
    transition: var(--transition);
}

.score-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(243, 198, 35, 0.2);
}

.score-rank-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-rank {
    font-size: 0.9rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.score-name {
    font-weight: 600;
    font-size: 1rem;
}

.score-costume {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 8px;
}

.score-val {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gold);
}

/* Duck Banner */
.duck-banner {
    background: linear-gradient(90deg, rgba(243, 198, 35, 0.15) 0%, rgba(243, 198, 35, 0.03) 100%);
    border: 1px solid rgba(243, 198, 35, 0.2);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    animation: pulseGlow 3s infinite alternate;
}

.duck-banner-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.duck-banner-count {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
    font-family: var(--header-font);
}

/* History logs list */
.log-item {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--gold);
}

.log-item.chore {
    border-left-color: #3498db;
}

.log-item.guess {
    border-left-color: var(--success);
}

.log-item.duck {
    border-left-color: #f1c40f;
}

.log-item.enigma {
    border-left-color: #9b59b6;
}

.log-item-details {
    display: flex;
    flex-direction: column;
}

.log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.log-points-badge {
    background: rgba(243, 198, 35, 0.15);
    color: var(--gold);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: bold;
}

/* Toast Messages */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: rgba(20, 10, 48, 0.9);
    border: 1px solid var(--gold);
    color: var(--text-color);
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    animation: slideDown 0.3s ease-out;
}

.toast.success {
    border-color: var(--success);
    color: #2ecc71;
}

.toast.error {
    border-color: var(--error);
    color: #e74c3c;
}

/* Tables for Admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--gold);
    font-weight: 600;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(243, 198, 35, 0.1); }
    100% { box-shadow: 0 0 20px rgba(243, 198, 35, 0.35); }
}

/* Photo Gallery & Uploads */
.user-photo-thumb {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(243, 198, 35, 0.35);
    flex-shrink: 0;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.user-photo-thumb:hover {
    transform: scale(1.08);
    border-color: var(--gold);
}
