:root {
    --bg: #FFF8E7;
    --bg-card: #FFFFFF;
    --text: #2D1B00;
    --text-muted: #8B7355;
    --primary: #FF6B9D;
    --primary-dark: #E5548A;
    --success: #4CAF50;
    --success-light: #E8F5E9;
    --warning: #FFC107;
    --danger: #FF5252;
    --accent-1: #9C6ADE;
    --accent-2: #50C8FF;
    --egg-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    --card-shadow: 0 2px 12px rgba(45, 27, 0, 0.08);
    --radius: 16px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.view {
    display: none;
    min-height: 100vh;
    padding-bottom: 40px;
}
.view.active {
    display: block;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Logo */
.logo {
    text-align: center;
    padding: 40px 0 30px;
}
.egg-icon {
    font-size: 80px;
    display: block;
    animation: egg-bounce 2s ease-in-out infinite;
}
@keyframes egg-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
.logo h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 10px;
}
.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}
.info-card p {
    margin: 6px 0;
}
.code {
    font-family: monospace;
    font-size: 1.4rem;
    color: var(--accent-1);
    letter-spacing: 2px;
}

/* Inputs */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E8DCC8;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}
input:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    width: 100%;
    text-align: center;
}
.btn:active {
    transform: scale(0.97);
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--egg-shadow);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}
.btn-success {
    background: var(--success);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
    margin-top: 12px;
}
.btn-large {
    padding: 18px 28px;
    font-size: 1.3rem;
    min-height: 64px;
}

/* Header bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px 0;
}
.header-bar h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

/* GPS badge */
.gps-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    background: #999;
}
.gps-badge.good { background: var(--success); }
.gps-badge.ok { background: var(--warning); color: var(--text); }
.gps-badge.poor { background: var(--danger); }

/* Logout */
.btn-logout {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid var(--text-muted);
    background: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
}
.btn-logout:active {
    background: var(--text-muted);
    color: white;
}

/* Link button */
.btn-link {
    display: block;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    margin: 16px auto;
    padding: 8px;
}

/* Tag grid */
.tag-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.tag-btn {
    padding: 14px 12px;
    border: 2px solid #E8DCC8;
    border-radius: 12px;
    background: white;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    text-align: center;
}
.tag-btn:active {
    transform: scale(0.95);
    background: var(--primary);
    color: white;
}

/* Radius buttons */
.radius-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 2px solid #E8DCC8;
    background: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.radius-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #f0e8d8;
    border-radius: 12px;
    padding: 4px;
}
.tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: none;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.tab.active {
    background: white;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Color grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0;
}
.color-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 4px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    font-size: 0;
    min-height: 56px;
}
.color-btn:active {
    transform: scale(0.9);
}
.color-btn.selected {
    border-color: var(--text);
    transform: scale(1.1);
}
.color-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.color-btn[data-color="rot"] { background: #E53935; }
.color-btn[data-color="blau"] { background: #1E88E5; }
.color-btn[data-color="gelb"] { background: #FDD835; }
.color-btn[data-color="gruen"] { background: #43A047; }
.color-btn[data-color="lila"] { background: #8E24AA; }
.color-btn[data-color="rosa"] { background: #F48FB1; }
.color-btn[data-color="orange"] { background: #FF9800; }
.color-btn[data-color="gold"] { background: linear-gradient(135deg, #FFD700, #FFA000); }

/* Color labels */
.color-label {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 4px;
    color: var(--text-muted);
}

/* Feedback */
.feedback {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    min-height: 30px;
    margin: 12px 0;
    transition: opacity 0.3s;
}
.feedback.success { color: var(--success); }
.feedback.error { color: var(--danger); }
.error { color: var(--danger); text-align: center; margin-top: 8px; }

/* Finds list */
.finds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.find-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}
.find-badge .time {
    opacity: 0.8;
    font-weight: 400;
}

/* Leaderboard */
.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0e8d8;
}
.leaderboard-row:last-child {
    border-bottom: none;
}
.lb-rank {
    width: 30px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}
.lb-name {
    flex: 1;
    font-weight: 700;
}
.lb-count {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent-1);
}
.lb-all-found {
    color: var(--success);
}

/* Admin egg list */
.egg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0e8d8;
}
.egg-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}
.egg-item .delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* Waiting animation */
.waiting-animation {
    text-align: center;
    font-size: 60px;
    animation: hop 1s ease-in-out infinite;
}
@keyframes hop {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(-10deg); }
    75% { transform: translateY(-20px) rotate(10deg); }
}

/* Celebration */
.celebration {
    text-align: center;
    background: linear-gradient(135deg, #FFF8E7, #FFE0EC);
}
.celebration h2 {
    color: var(--primary);
    margin-bottom: 16px;
}

/* Confetti */
.confetti-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
    opacity: 0;
    animation: confetti-fall 3s ease-in forwards;
}
@keyframes confetti-fall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* All found overlay */
.all-found-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.all-found-overlay.show {
    display: flex;
}
.all-found-content {
    text-align: center;
    color: white;
    padding: 40px;
    animation: pop-in 0.5s ease-out;
}
.trophy {
    font-size: 100px;
    animation: trophy-spin 1s ease-out;
}
@keyframes trophy-spin {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0deg); }
}
@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.all-found-content h1 {
    font-size: 2rem;
    margin: 20px 0 10px;
    color: #FFD700;
}
.all-found-content p {
    font-size: 1.2rem;
}

/* Stats */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0e8d8;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 700; }
.winner-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.85rem;
}

/* Grass footer */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to top, #7CB342, transparent);
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}
