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

:root {
    --primary: #2D6A2D;
    --secondary: #1a3d1a;
    --accent: #ffffff;
    --team-color: #2D6A2D;
    --text: #1a1a1a;
    --text-muted: #555;
    --bg: #f5f7f5;
    --card-bg: #ffffff;
    --error: #c00000;
    --success: #2D6A2D;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--primary);
    color: var(--accent);
    text-align: center;
    padding: 1rem 1rem 1.25rem;
}

.logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 4px;
}

.title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.pause-banner,
.waiting-banner {
    background: #BF8F00;
    color: white;
    text-align: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.waiting-banner {
    background: #4472C4;
}

.main {
    flex: 1;
    padding: 1rem;
}

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

.team-header h2 {
    font-size: 1.5rem;
    color: var(--team-color);
    font-weight: 800;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-success {
    text-align: center;
}

.card-error {
    text-align: center;
    padding: 2rem 1.25rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.progress-info {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--team-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.station-foto,
.geo-foto {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    object-fit: cover;
    max-height: 220px;
    background: #e8e8e8;
}

.coords {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.coords p {
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.link-btn {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
}

.aufgabe {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hinweis {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.schluessel-hinweis {
    background: #f0f7f0;
    border-left: 4px solid var(--team-color);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    border-radius: 0 8px 8px 0;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.input-number {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 0.75rem 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    margin-bottom: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.input-number:focus {
    outline: none;
    border-color: var(--team-color);
}

.btn {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--team-color);
    color: white;
}

.btn-primary:active:not(:disabled) {
    opacity: 0.85;
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.error-msg {
    color: var(--error);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.loesungszahl {
    font-size: 3rem;
    font-weight: 800;
    color: var(--team-color);
    margin: 0.5rem 0 1rem;
}

.loesungszahl-label {
    font-size: 1rem;
}

.note {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.station-selfie-box {
    background: #f0f7f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.25rem 0;
}

.station-selfie-box h3 {
    margin: 0 0 0.35rem;
    font-size: 1.0625rem;
}

.station-selfie-hint {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.selfie-preview {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 0 0.75rem;
    border-radius: 8px;
    background: #ddd;
}

.selfie-preview.hidden {
    display: none;
}

.selfie-file-input {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.selfie-msg {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.selfie-msg.hidden {
    display: none;
}

.station-selfie-box.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.geo-map-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.75rem 0 0.25rem;
}

.geo-map {
    width: 100%;
    height: min(420px, 55vh);
    min-height: 300px;
    border-radius: 8px;
    margin: 1rem 0;
    border: 2px solid #ddd;
    z-index: 1;
    overflow: hidden;
    background: #e8e8e8;
}

.geo-map .leaflet-container {
    width: 100%;
    height: 100%;
    font-family: inherit;
}

.geo-map .leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.85) !important;
}

.geo-coords {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

.geo-name {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.loesungswort-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.loesungswort-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.loesungswort-row label {
    flex: 0 0 100px;
    font-weight: 600;
    font-size: 0.9375rem;
}

.loesungswort-row input {
    flex: 1;
    min-height: 48px;
    font-size: 16px;
    padding: 0.75rem 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
}

.loesungswort-row input:focus {
    outline: none;
    border-color: var(--team-color);
}

.footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

.view {
    animation: fadeIn 0.25s ease;
}

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

.offline-notice {
    background: var(--error);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
}
