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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c43 100%);
    color: white;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Bouton retour */
.btn-back {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: rgba(255,255,255,0.3);
}

/* Liste des aventures */
.adventure-card {
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.adventure-card:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.25);
}

.adventure-card h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.adventure-card p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.adventure-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.8;
}

.difficulty {
    color: #ffd700;
}

.progress {
    color: #90EE90;
}

/* Ecran de jeu */
.step-container {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

.step-progress {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.step-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.step-hint {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

/* Formulaire de reponse */
.answer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-input {
    padding: 15px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    text-align: center;
    background: white;
    color: #333;
}

.answer-input:focus {
    outline: 3px solid #ffd700;
}

.btn-submit {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: #ffd700;
    color: #333;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: scale(1.02);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Messages de feedback */
.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    display: none;
}

.feedback.success {
    display: block;
    background: rgba(144, 238, 144, 0.3);
    border: 2px solid #90EE90;
}

.feedback.error {
    display: block;
    background: rgba(255, 99, 71, 0.3);
    border: 2px solid #ff6347;
}

/* Bouton continuer */
.btn-continue {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: #90EE90;
    color: #333;
    cursor: pointer;
    display: none;
}

.btn-continue.visible {
    display: inline-block;
}

/* Ecran de fin */
.end-screen {
    text-align: center;
    padding: 40px 20px;
}

.end-screen .emoji {
    font-size: 5rem;
    margin-bottom: 20px;
}

.end-screen h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.end-screen p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Ecrans de resultat (succes/erreur) */
.success-screen,
.error-screen {
    text-align: center;
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.result-message {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
}

.success-screen .result-message {
    background: rgba(144, 238, 144, 0.2);
    border: 2px solid rgba(144, 238, 144, 0.5);
}

.error-screen .result-message {
    background: rgba(255, 152, 0, 0.2);
    border: 2px solid rgba(255, 152, 0, 0.5);
}

.btn-home {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: #ffd700;
    color: #333;
    cursor: pointer;
}

/* Etat vide */
.empty-state {
    text-align: center;
    padding: 40px;
    opacity: 0.8;
}

.empty-state .emoji {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Banniere hors-ligne */
#offline-banner {
    background: #ff9800;
    color: #333;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

#offline-banner .offline-icon {
    font-size: 1.1rem;
}

/* Decalage du body quand la banniere est presente */
body:has(#offline-banner) {
    padding-top: 60px;
}

/* Aventure non disponible (hors-ligne et pas en cache) */
.adventure-card.adventure-unavailable {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255,255,255,0.08);
}

.adventure-card.adventure-unavailable:hover {
    transform: none;
    background: rgba(255,255,255,0.08);
}

.unavailable-notice {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #ffcc80;
}

/* Badge "en cache" */
.cached-badge {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #90EE90;
    opacity: 0.9;
}

/* ============================================
   MENU SETTINGS
   ============================================ */

/* Header avec bouton settings */
header {
    position: relative;
}

.btn-settings {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    font-size: 1.4rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-settings:hover {
    background: rgba(255,255,255,0.25);
}

/* Menu deroulant */
.settings-menu {
    position: absolute;
    top: 60px;
    right: 20px;
    z-index: 100;
    transition: opacity 0.2s, transform 0.2s;
}

.settings-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.settings-menu-content {
    background: rgba(30, 60, 30, 0.98);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.settings-item:hover {
    background: rgba(255,255,255,0.1);
}

.settings-item:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.settings-icon {
    font-size: 1.2rem;
}

/* ============================================
   PAGES SETTINGS
   ============================================ */

.settings-page {
    padding-bottom: 30px;
}

.settings-page h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.settings-description {
    opacity: 0.8;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.settings-card {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}

.settings-card-disabled {
    opacity: 0.5;
}

.settings-card-header {
    background: rgba(0,0,0,0.2);
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.settings-card-content {
    padding: 15px;
}

.settings-card-content p {
    margin-bottom: 8px;
}

.settings-card-content p:last-child {
    margin-bottom: 0;
}

.cache-list {
    margin: 10px 0 0 0;
    padding-left: 20px;
    font-size: 0.8rem;
    opacity: 0.8;
    max-height: 200px;
    overflow-y: auto;
}

.cache-list li {
    margin-bottom: 4px;
    word-break: break-all;
}

.empty-text {
    opacity: 0.6;
    font-style: italic;
}

.error-text {
    color: #ff6b6b;
}

/* Items de sauvegarde */
.save-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.save-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.save-item:first-child {
    padding-top: 0;
}

.save-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.save-status {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Boutons actions */
.settings-actions {
    margin-top: 25px;
    text-align: center;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.85rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-danger {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: rgba(220, 53, 69, 1);
}

/* ============================================
   NAVIGATION GPS / BOUSSOLE
   ============================================ */

.navigation-screen {
    text-align: center;
}

.nav-instruction {
    font-size: 1.1rem;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    color: #ffd700;
}

.compass-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 25px;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.compass-arrow {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out;
}

.arrow-svg {
    width: 80px;
    height: 80px;
    color: #ffd700;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.nav-distance {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
}

.nav-accuracy {
    font-size: 0.85rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.nav-accuracy.accuracy-good {
    color: #90EE90;
}

.nav-accuracy.accuracy-medium {
    color: #ffd700;
}

.nav-accuracy.accuracy-poor {
    color: #ff9800;
}

.btn-permission {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background 0.2s;
}

.btn-permission:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-permission.hidden {
    display: none;
}

.nav-error {
    background: rgba(255, 99, 71, 0.3);
    border: 2px solid #ff6347;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.95rem;
}

.nav-error.hidden {
    display: none;
}

/* Animation pulse pour la distance quand on approche */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.nav-distance.close {
    animation: pulse 1s infinite;
    color: #90EE90;
}

/* ============================================
   BANNIERE DE MISE A JOUR
   ============================================ */

#update-banner {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#update-banner button {
    background: white;
    color: #4CAF50;
    border: none;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

#update-banner button:hover {
    transform: scale(1.05);
}

#update-banner button.close {
    background: transparent;
    color: white;
    padding: 4px 8px;
    font-size: 1rem;
}

/* Decalage du body quand les deux bannieres sont presentes */
body:has(#update-banner) {
    padding-top: 60px;
}

body:has(#update-banner):has(#offline-banner) {
    padding-top: 100px;
}

body:has(#update-banner):has(#offline-banner) #offline-banner {
    top: 44px;
}

/* ============================================
   PAGE MISES A JOUR
   ============================================ */

.update-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-update {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-update:hover {
    transform: translateY(-1px);
}

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

.btn-update {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-update:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-update-apply {
    background: #4CAF50;
    color: white;
    border: none;
}

.btn-update-apply:hover {
    background: #45a049;
}

.btn-update-force {
    background: rgba(255, 152, 0, 0.3);
    color: #ffcc80;
    border: 1px solid rgba(255, 152, 0, 0.5);
}

.btn-update-force:hover {
    background: rgba(255, 152, 0, 0.4);
}

.update-hint {
    margin-top: 15px;
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
}

/* ============================================
   BOUTON PASSER (MODE DEVELOPPEUR)
   ============================================ */

.btn-skip-dev {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 152, 0, 0.3);
    border: 2px dashed rgba(255, 152, 0, 0.7);
    color: #ffcc80;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-skip-dev:hover {
    background: rgba(255, 152, 0, 0.5);
    border-color: #ff9800;
}

/* ============================================
   PAGE DEBOGAGE
   ============================================ */

/* Toggle mode dev */
.dev-mode-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.toggle-info {
    flex: 1;
}

.toggle-description {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 8px !important;
}

.btn-toggle {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-toggle.active {
    background: rgba(76, 175, 80, 0.6);
    border-color: #4CAF50;
}

/* Console de debug */
.debug-console {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #888;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.log-icon {
    flex-shrink: 0;
}

.log-message {
    word-break: break-word;
    white-space: pre-wrap;
}

.log-info .log-message {
    color: #b0bec5;
}

.log-warn .log-message {
    color: #ffb74d;
}

.log-error .log-message {
    color: #ef5350;
}

/* Bouton effacer les logs */
.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-clear-logs {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-clear-logs:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Infos systeme */
.system-info {
    font-size: 0.8rem;
    opacity: 0.7;
    word-break: break-all;
    margin-bottom: 15px !important;
}

/* Animation shake pour mauvaise reponse */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.net-indicator {
    margin-left: auto;
    color: #ff6b6b;
    font-size: 1.1rem;
    line-height: 1;
}