/* === FONT IMPORT === */
@font-face {
    font-family: 'Suisse';
    src: url('fonts/suisse.woff2') format('woff2'),
         url('fonts/suisse.woff') format('woff'),
         url('fonts/suisse.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Emoji fallback for systemer som ikke støtter emojis */
.emoji-fallback {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", sans-serif;
}

.emoji-fallback::before {
    content: "";
}

/* Fallback til tekst hvis emoji ikke vises */
@supports not (font-family: "Apple Color Emoji") {
    .emoji-fallback[data-emoji="tannhelse"]::after { content: " "; }
    .emoji-fallback[data-emoji="palestina"]::after { content: " "; }
    .emoji-fallback[data-emoji="strom"]::after { content: " "; }
    .emoji-fallback[data-emoji="penger"]::after { content: " "; }
    .emoji-fallback[data-emoji="natur"]::after { content: " "; }
    .emoji-fallback[data-emoji="jobb"]::after { content: " "; }
    .emoji-fallback[data-emoji="pensjon"]::after { content: " "; }
    .emoji-fallback[data-emoji="hjelp"]::after { content: " "; }
    .emoji-fallback[data-emoji="velferd"]::after { content: " "; }
    .emoji-fallback[data-emoji="styrke"]::after { content: " "; }
    .emoji-fallback[data-emoji="feiring"]::after { content: " "; }
    .emoji-fallback[data-emoji="kul"]::after { content: " "; }
}

/* === CSS VARIABLER === */
:root {
    --primary-gradient-start: #e90302;
    --primary-gradient-end: #db4747;
    --button-gradient-start: #ffd100;
    --button-gradient-end: #c2a731;
    --progress-color: #ffffff;
    --accent-color: #ffffff;
    --text-color: white;
    --button-text-color: #000000;
    --shadow-color: rgba(46, 46, 46, 0.3);

    --main-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --button-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --title-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
}

html {
    /* Tillat vertikal scrolling for tilfeller hvor innholdet blir for høyt */
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: var(--main-font);
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Endret fra center til flex-start */
    padding: 20px 10px 20px 10px; /* Økt topp/bunn padding */
    /* Tillat scrolling hvis innholdet blir for høyt */
    overflow-x: hidden;
    overflow-y: auto;
    /* Forhindre tekst-seleksjon på mobil */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Forhindre tap-highlight på mobil */
    -webkit-tap-highlight-color: transparent;
    /* Forbedre scrolling på iOS */
    -webkit-overflow-scrolling: touch;
}

.game-container {
    text-align: center;
    color: var(--text-color);
    position: relative;
    max-width: 600px;
    width: 100%;
    /* Sørg for at containeren ikke blir for høy */
    max-height: none;
    /* Legg til margin for å sentere bedre når det er plass */
    margin: auto 0;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
}

/* === Tekst spacing === */
.game-title {
    font-family: var(--title-font);
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px var(--shadow-color);
    line-height: 1.3;
}

.game-description {
    font-family: var(--main-font);
    font-size: clamp(0.9rem, 3.5vw, 1.3rem);
    font-weight: 400;
    margin-bottom: 20px; 
    opacity: 0.9;
    line-height: 1.4;
}

/* === Visual separator === */
.header-divider {
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    margin: 0 auto 30px auto;
}

/* === Game area med bedre responsivitet === */
.game-area {
    position: relative;
    /* Bruk viewport-basert høyde, men sett maksimum og minimum */
    height: clamp(250px, 35vh, 350px);
    width: 100%;
    margin-top: 30px;
    margin-bottom: 20px;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
}

/* === Progress bar === */
.progress-bar {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    overflow: hidden;
    z-index: 15;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--progress-color), var(--progress-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 25px;
    z-index: 15;
}

/* === Knapp === */
.click-button {
    width: clamp(100px, 20vw, 160px);
    height: clamp(100px, 20vw, 160px);
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--button-gradient-start), var(--button-gradient-end));
    color: var(--button-text-color);
    font-family: var(--button-font);
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px var(--shadow-color);
    margin: 15px auto;
    display: block;
    line-height: 1.2;
    padding: 8px;
    z-index: 20;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
    /* Forhindre tap-highlight på mobil */
    -webkit-tap-highlight-color: transparent;
    /* Forbedre tapprespons på mobil */
    -webkit-touch-callout: none;
}

.click-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

.click-button:active {
    transform: scale(0.95);
}

/* === Marie === */
.game-image {
    position: absolute;
    bottom: 23px; /* Justert for å ligge helt på progressbaren */
    left: 50%;
    transform: translateX(-50%);
    width: clamp(80px, 12vw, 100px); /* Matchende startstørrelse som i JS */
    height: auto;
    transition: all 0.3s ease;
    pointer-events: none;
    filter: drop-shadow(0px 4px 20px rgba(255, 255, 255, 0));
    z-index: 10;
}

.game-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    /* Forbedre bildevisning på mobil */
    max-width: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Forhindre bildeseleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    /* Forhindre høyreklikkmeny */
    -webkit-touch-callout: none;
}

/* === Slogans === */
.slogan {
    position: absolute;
    font-family: var(--main-font);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    font-weight: medium;
    color: var(--accent-color);
    text-shadow: 
        2px 2px 8px rgba(0, 0, 0, 0.8),
        0px 0px 12px rgba(0, 0, 0, 0.6),
        -2px -2px 8px rgba(0, 0, 0, 0.8),
        0px 0px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 1);
    z-index: 25;
    max-width: 250px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 6px;
    /* Forhindre tekst-seleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.slogan.show {
    opacity: 1;
    transform: translateY(-80px) scale(1);
}

/* === Win screen === */
.win-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* Tillat scrolling i win screen også */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
}

.win-content {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    padding: clamp(15px, 3vw, 30px);
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    color: var(--text-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Sentrer win content vertikalt i tilgjengelig plass */
    margin: auto;
}

.win-text-container {
    max-height: 75vh;
    overflow-y: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

.win-image {
    width: clamp(50px, 10vw, 70px);
    height: clamp(50px, 10vw, 70px);
    margin-bottom: 15px;
    flex-shrink: 0;
}

.win-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Forbedre bildevisning på mobil */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Forhindre bildeseleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.win-title {
    font-family: var(--title-font);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px var(--shadow-color);
    line-height: 1.3;
}

.win-message {
    font-family: var(--main-font);
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    line-height: 1.5;
    margin-bottom: 25px;
    text-align: center;
    max-width: 500px;
    /* Tillat tekst-seleksjon i win message */
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

.win-message p {
    margin-bottom: 15px;
}

.win-message p:last-child {
    margin-bottom: 0;
}

.win-message strong {
    font-weight: bold;
    color: var(--accent-color);
}

.win-message a {
    color: var(--accent-color);
    text-decoration: underline;
}

.win-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

/* === Epleboks === */
.apple-message-box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    border: 2px solid white;
    border-radius: 15px;
    max-width: 320px;
    width: 90vw;
    padding: 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    word-break: break-word;
    white-space: normal;
    font-family: var(--main-font);
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    line-height: 1.5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
}

.apple-message-content {
    margin-bottom: 18px;
}

.apple-image {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apple-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Forbedre bildevisning på mobil */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Forhindre bildeseleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.apple-close-btn {
    background: linear-gradient(135deg, var(--button-gradient-start), var(--button-gradient-end));
    color: var(--button-text-color);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-family: var(--button-font);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
    /* Forhindre tap-highlight på mobil */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.apple-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* === Fade + shake animasjon for epleboks === */
@keyframes fadeShake {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) translateY(20px) scale(0.9);
    }
    30% { 
        opacity: 1; 
        transform: translate(-50%, -50%) translateY(-5px) translateX(-3px) scale(1.02);
    }
    50% { 
        transform: translate(-50%, -50%) translateY(0) translateX(3px) scale(1.01);
    }
    70% { 
        transform: translate(-50%, -50%) translateY(-2px) translateX(-2px) scale(1);
    }
    100% { 
        transform: translate(-50%, -50%) translateY(0) translateX(0) scale(1);
    }
}

.fade-shake {
    animation: fadeShake 0.5s ease forwards;
}

/* === Epler === */
.apple {
    position: absolute;
    cursor: pointer;
    z-index: 12;
    width: 28px;
    height: 35px;
    user-select: none;
    transition: transform 0.2s;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 2px black);
    border-radius: 50%;
    animation: float 3s ease-in-out infinite;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
    /* Forhindre tap-highlight på mobil */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    /* Forhindre bildeseleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
}

.apple:hover {
    transform: scale(1.1);
}

.apple:active {
    transform: scale(0.9) rotate(-10deg);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-6px) rotate(1deg);
    }
    50% {
        transform: translateY(-3px) rotate(-1deg);
    }
    75% {
        transform: translateY(-9px) rotate(0.5deg);
    }
}

/* === Knappene på win screen === */
.forward-button {
    background: linear-gradient(135deg, var(--progress-color), var(--progress-color));
    color: #000000;
    border: none;
    padding: clamp(10px, 2.5vw, 13px) clamp(18px, 4vw, 25px);
    border-radius: 20px;
    font-family: var(--button-font);
    font-size: clamp(0.8rem, 2vw, 1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
    /* Forhindre tap-highlight på mobil */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.forward-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.reset-button {
    background: rgba(255,255,255,0.2);
    color: var(--text-color);
    border: 2px solid var(--text-color);
    padding: clamp(8px, 2vw, 10px) clamp(16px, 3.5vw, 22px);
    border-radius: 20px;
    font-family: var(--button-font);
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
    /* Forhindre tap-highlight på mobil */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.reset-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* === Logo i hjørnet === */
.corner-logo {
    position: fixed;
    bottom: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    transition: all 0.3s ease;
    /* Forhindre zoom ved dobbelttrykk */
    touch-action: manipulation;
}

.corner-logo:hover {
    transform: translateY(-3px);
}

.logo-image {
    width: clamp(35px, 6vw, 50px);
    height: clamp(35px, 6vw, 50px);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Forhindre bildeseleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.logo-tagline {
    font-family: var(--main-font);
    font-size: clamp(0.55rem, 1.2vw, 0.7rem);
    font-weight: 300;
    color: var(--text-color);
    text-align: center;
    opacity: 0.9;
    max-width: 90px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    line-height: 1.2;
    /* Forhindre tekst-seleksjon */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

/* === Responsiv design === */
@media (max-width: 480px) {
    body {
        /* Forhindre overscrolling på mobil */
        overscroll-behavior: none;
        padding: 15px 10px 60px 10px; /* Mer bunn-padding på mobil */
    }
    
    .game-container {
        margin: 0; /* Fjern auto margin på mobil */
    }
    
    .game-area {
        height: clamp(200px, 30vh, 280px); /* Mindre høyde på mobil */
        margin-top: 20px;
        margin-bottom: 15px;
    }
    
    .win-content {
        padding: 12px;
        margin: 10px;
        border-radius: 12px;
    }
    
    .win-message {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .apple-message-box {
        max-width: 280px;
        padding: 15px;
        border-radius: 12px;
    }
    
    .win-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .forward-button,
    .reset-button {
        width: 100%;
        max-width: 220px;
    }
    
    /* Forbedre tapp-responsivitet på små skjermer */
    .click-button {
        min-width: 100px;
        min-height: 100px;
    }
    
    /* Mindre logo på mobil */
    .corner-logo {
        bottom: 10px;
        right: 10px;
    }
}

/* === Extra små skjermer === */
@media (max-width: 360px) {
    .game-title {
        font-size: 1.1rem;
    }
    
    .game-description {
        font-size: 0.85rem;
    }
    
    .game-area {
        height: clamp(180px, 25vh, 250px);
    }
}

/* === Høye skjermer (talle telefoner) === */
@media (min-height: 800px) {
    body {
        align-items: center; /* Sentrer innholdet vertikalt på høye skjermer */
    }
    
    .game-area {
        height: clamp(280px, 40vh, 400px); /* Større spill-område på høye skjermer */
    }
}

/* === Svært brede skjermer === */
@media (min-width: 1200px) {
    .game-container {
        max-width: 700px;
    }
    
    .game-area {
        height: clamp(350px, 45vh, 450px);
    }
}

