:root {
    --primary-color: #5C4033;
    /* Dark Brown (Dirt/Tunnel) */
    --hover-color: #3E2723;
    --background: #E8F5E9;
    /* Light Grass Green */
    --surface: #FDF8F5;
    /* Off-white warm */
    --text-main: #2D1A11;
    /* Very dark brown text */
    --text-muted: #795548;
    --border: #D7CCC8;
    --success: #388E3C;
    /* Darker green */
    --success-bg: #E8F5E9;
    --danger: #D84315;
    --danger-bg: #FBE9E7;

    --shadow-sm: 0 1px 3px rgba(92, 64, 51, 0.1), 0 1px 2px rgba(92, 64, 51, 0.2);
    --shadow-md: 0 4px 6px rgba(92, 64, 51, 0.1);
    --shadow-lg: 0 10px 20px rgba(92, 64, 51, 0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Utilities */
.view {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 32px;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.search-bar {
    flex-grow: 1;
    max-width: 800px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    border: none;
    background: #EFEFEF;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(230, 0, 35, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: #EFEFEF;
}

.btn-create,
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-create:hover,
.btn-primary:hover {
    background: var(--hover-color);
}

.btn-create:active,
.btn-primary:active {
    transform: scale(0.95);
}

.create-menu {
    display: flex;
    gap: 8px;
    background: #EFEFEF;
    padding: 4px;
    border-radius: var(--radius-full);
}

.create-menu .btn-create {
    padding: 8px 16px;
    font-size: 0.9rem;
    box-shadow: none;
}

.tunnel-btn {
    background: #8D6E63;
    /* Lighter brown for tunnels */
}

.tunnel-btn:hover {
    background: #6D4C41;
}

.btn-secondary {
    background: #EFEFEF;
    color: var(--text-main);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #E1E1E1;
}

.btn-back {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.btn-back:hover {
    background: #EFEFEF;
    color: var(--text-main);
}

/* Authentication Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 26, 17, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.btn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-close:hover {
    background: #EFEFEF;
    color: var(--text-main);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-form {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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