@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Karla:wght@400;500;600;700&display=swap');

:root {
    --background: #fafafa;
    --foreground: #1a1a1a;
    --card: #ffffff;
    --primary: #ffeb99;
    --primary-foreground: #1a1a1a;
    --secondary: #c8b89b;
    --muted: #f0ede8;
    --muted-foreground: #666677;
    --accent: #a5d6fc;
    --border: #e0dcd4;
    --cell-active: #89c6f5;
    --cell-highlighted: #bfe0fa;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(255, 235, 153, 0.4);
    --font-serif: 'Libre Baskerville', Georgia, serif;
    --font-sans: 'Karla', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#mobile-warning {
    display: none;
    z-index: 9999; 
    background: var(--background);
}

@media (max-width: 700px) {
    
    #mobile-warning {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
    }

    #start-screen, 
    #game-screen, 
    #pause-overlay, 
    #end-screen,
    #navbar { 
        display: none !important;
    }
}

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--background);
    z-index: 100;
}

.screen.hidden {
    display: none;
}

#game-screen {
    position: relative;
        margin: 60px;
    overflow-y: auto;
    align-items: flex-start;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulseSoft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

.startindhold {
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.kklogomærke {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-foreground);
    box-shadow: var(--shadow-medium);
}

.kkmærke {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.starttitel {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    animation: slideUp 0.6s ease-out 0.1s both;
}

.startundetitel {
    color: var(--muted-foreground);
    font-size: 1.125rem;
    animation: slideUp 0.6s ease-out 0.15s both;
}

.startunderundertitel {
    width: 96px;
    height: 2px;
    background: var(--primary);
    margin: 2rem auto;
    animation: slideUp 0.6s ease-out 0.2s both;
}

.startbeskrivelse {
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    animation: slideUp 0.6s ease-out 0.3s both;
}

.kkbtnmain {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out 0.4s both;
}

.kkbtnmain:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.kkbtnmain svg {
    transition: transform 0.2s ease;
}

.kkbtnmain:hover svg {
    transform: scale(1.1);
}

.starttekstunderbtn {
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    opacity: 0.7;
    animation: slideUp 0.6s ease-out 0.5s both;
}


#pause-overlay {
    background: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(8px);
    z-index: 200;
}

.pauseindhold {
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.pauseikon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: var(--muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-soft);
}

.pausebar {
    width: 12px;
    height: 40px;
    background: var(--muted-foreground);
    border-radius: 4px;
}

.pausetitel {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pause-tdi {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

#error-overlay {
    background: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(8px);
    z-index: 200;
}

.fejlindhold {
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.fejlikon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: #ffebee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
}

.fejlikon svg {
    stroke: #c62828;
}

.fejlamintitel {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #c62828;
}

.fejlundertitel {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}


#end-screen {
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(8px);
    z-index: 300;
}

#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    border-radius: 2px;
    animation: confettiFall 3s linear forwards;
}

.gennemførtindhold {
    text-align: center;
    animation: slideUp 0.7s ease-out;
}

.trofæikon {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    animation: pulseSoft 2s ease-in-out infinite;
}

.trofæikon svg {
    stroke: var(--primary-foreground);
}

.tillykketitel {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tillykkeundertitel {
    color: var(--muted-foreground);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.tidvistpænere {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 0 auto 0.5rem;
    max-width: 200px;
    box-shadow: var(--shadow-soft);
}

.tidvistpænere svg {
    stroke: var(--accent);
}

.endeligtidtekst {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
}

.tidsmærke {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.tillykkebesked {
    color: var(--muted-foreground);
    font-style: italic;
    margin-bottom: 2rem;
}

.sekunddærbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--secondary);
    color: var(--foreground);
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sekunddærbtn:hover {
    background: #b8a88b;
}

.sekunddærbtn:hover svg {
    transform: rotate(-180deg);
}

.btn-secondary svg {
    transition: transform 0.5s ease;
}

.spillayout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

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

.headerkk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-badge-small {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.headerundertitel {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.spiltitel {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.game-subtitle {
    color: var(--muted-foreground);
}

.tidsboksspil {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.tidsdisplay {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-soft);
}

.tidsdisplay svg {
    stroke: var(--muted-foreground);
}

#timer {
    font-family: monospace;
    font-size: 1.125rem;
    font-weight: 600;
    min-width: 60px;
}

.btnpausespil {
    width: 60px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
}

.btnpausespil:hover {
    box-shadow: var(--shadow-medium);
}


.kkmainindhold {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.kkfeltermain {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: var(--muted);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border);
}

.kkfelter {
    display: grid;
    gap: 0;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: var(--card);
}

.crossword-cell {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    user-select: none;
}

.crossword-cell:hover:not(.cell-black) {
    background: var(--muted);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cell-black {
    background: #000;
    cursor: default;
    border-color: #000;
}

.cell-active {
    background: var(--cell-active) !important;
    border-color: var(--accent) !important;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(137, 198, 245, 0.4);
}

.cell-highlighted {
    background: var(--cell-highlighted) !important;
    border-color: rgba(165, 214, 252, 0.3) !important;
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1;
    background: var(--primary);
    padding: 1px 4px;
    border-radius: 2px;
}

.cell-letter {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
    text-transform: uppercase;
}


.kkspilhint {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hintsektion {
    background: var(--primary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--primary);
    transition: border-color 0.2s ease;
}

.hintsektion.active {
    border-left-color: var(--accent);
}

.titelhint {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.hintliste {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clue-item {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--primary-foreground);
    opacity: 0.9;
    transition: all 0.15s ease;
    cursor: default;
}

.clue-item:hover {
    opacity: 1;
    transform: translateX(4px);
}

.clue-number {
    font-weight: 700;
    margin-right: 0.25rem;
}


.spilfooter {
    text-align: center;

    margin-top: 300px;
    color: #c4c4c4; 
    opacity: 1; 
    font-size: 0.875rem;
    font-style: italic;
}


.spilfooter a {
    color: #efefef; 
    text-decoration: none; 
    font-weight: bold; 
    border-bottom: 1px solid transparent; 
    transition: all 0.3s ease; 
}


.spilfooter a:hover {
    color: #bdbdbd; 
    border-bottom: 1px solid #f5f5f5; 
}




@media (max-width: 1024px) {
    .crossword-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .start-title {
        font-size: 2.5rem;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .cell-letter {
        font-size: 1rem;
    }
    
    .cell-number {
        font-size: 0.45rem;
    }
    
    .clues-section {
        padding: 1rem;
    }
    
    .crossword-grid-wrapper {
        padding: 1rem;
    }
}
