:root {
    --primary: #2c3e50;
    --highlight: #e67e22;
    --text: #2d3436;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    margin: 0;
    padding: 0;
    background-image: url('https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

header {
    background-color: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

header h1 {
    font-family: 'Permanent Marker', cursive;
    font-size: 2.5rem;
    margin: 0;
    color: #f1c40f;
    letter-spacing: 2px;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

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

.dashboard-header h2 {
    color: white;
    font-family: 'Permanent Marker', cursive;
    font-size: 2.2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.trip-card {
    background-color: #faf8f5;
    padding: 1.5rem 1.5rem 4rem 1.5rem;
    position: relative;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.trip-card:nth-child(odd) { transform: rotate(-2deg); }
.trip-card:nth-child(even) { transform: rotate(3deg); }

.trip-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 25px rgba(0,0,0,0.6);
    z-index: 10;
}

.trip-card::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    width: 100px;
    height: 30px;
    background-color: rgba(240, 230, 140, 0.85);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.trip-card h3 {
    font-family: 'Permanent Marker', cursive;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--highlight);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn-primary:hover { background-color: #d35400; }
.btn-primary:active { transform: scale(0.97); }

.btn-delete {
    background-color: #e74c3c;
    color: white;
    margin-top: auto;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.btn-delete:hover { background-color: #c0392b; }

.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.ticket-style {
    background: #fdfbf7;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.ticket-style h3 {
    font-family: 'Permanent Marker', cursive;
    margin-top: 0;
    font-size: 1.8rem;
    text-align: center;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}

.btn-close:hover { color: #333; }

.form-card form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group input { flex: 1; }

input {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    background: rgba(255,255,255,0.9);
}

.paper-texture {
    background: #fdfbf7;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

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

.trip-header h2 {
    color: var(--primary);
    font-family: 'Permanent Marker', cursive;
    margin-top: 0;
}

.progress {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--highlight);
}

.game-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Map Scaling & Clipping Fixes */
#map-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#map-container svg {
    width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
}

/* Strictly style ONLY paths with a data-code (ignores shadows) */
#map-container path {
    fill: transparent;
    stroke: none;
    pointer-events: none;
}

#map-container path[data-code] {
    fill: #e0e0e0;
    stroke: #ffffff;
    stroke-width: 1.5;
    cursor: pointer;
    pointer-events: auto;
    transition: fill 0.3s, transform 0.1s;
}

#map-container path[data-code]:hover { fill: #bdc3c7; }
#map-container path[data-code].found { fill: var(--highlight); }

#discovery-panel img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    background: #fff;
}

.fact-box {
    background: #fff9e6;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid var(--highlight);
}

/* CSS Sprite Main Plate */
.sprite-plate {
    width: 100%;
    padding-bottom: 50%; /* Maintains a 2:1 aspect ratio */
    background-repeat: no-repeat;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    background-color: #fff;
}

/* Gallery Layout */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-item {
    text-align: center;
}

.gallery-item img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
}

.gallery-item span {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
    font-weight: 600;
}