:root {
    /* Colors - Soft & Premium */
    --primary: #94A3B8;
    --primary-dark: #64748B;
    --accent: #E0B0FF;
    /* Soft Lilac */
    --accent-dark: #C080EF;

    --bg-page: #F8FAFC;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.6);

    --text-main: #1E293B;
    --text-muted: #64748B;

    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Spacing */
    --radius-lg: 24px;
    --radius-md: 16px;

    --header-height: 60px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Gabarito', sans-serif;
    color: var(--text-main);
    margin: 0;
}

#app {
    max-width: 480px;
    /* Mobile first constrained width */
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    #app {
        max-width: 900px;
        border-radius: 20px;
        margin: 40px auto;
        min-height: auto;
    }
}

/* --- Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: var(--text-main);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.2);
}

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

.btn-secondary {
    background: var(--bg-page);
    color: var(--text-main);
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px solid #E2E8F0;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #F8FAFC;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

/* Cards */
.card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

/* Typography Helpers */
.text-center {
    text-align: center;
}

.text-hero {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1E293B 0%, #475569 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Animation Classes */
.animate-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

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

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

/* View Containers */
.view-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.view-centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Lock Screen Specifics */
.lock-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Photo Grid - Masonry-like */
.photo-grid {
    column-count: 1;
    /* Single column for 'Grand' display */
    column-gap: 15px;
    margin: 20px 0;
}

@media (min-width: 600px) {
    .photo-grid {
        column-count: 2;
        /* 2 columns on tablets */
    }
}

@media (min-width: 900px) {
    .photo-grid {
        column-count: 3;
        /* 3 columns on desktop */
    }
}

.photo-item {
    width: 100%;
    margin-bottom: 15px;
    border-radius: var(--radius-md);
    display: block;
    cursor: wait;
    /* Placeholder until loaded */
    transition: transform 0.2s;
    box-shadow: var(--shadow-soft);
}

.photo-item.loaded {
    cursor: zoom-in;
}

.photo-item:hover {
    transform: scale(1.01);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
}

/* Hangman Game Styles */
.hangman-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.word-display {
    display: flex;
    gap: 1%;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    justify-content: center;
    width: 100%;
}

.letter-slot {
    flex: 1;
    min-width: 0;
    max-width: 40px;
    height: 50px;
    border-bottom: 3px solid var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 8vw, 2.2rem);
    font-weight: bold;
    text-transform: uppercase;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 500px;
}

.key-btn {
    aspect-ratio: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.key-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
    transform: none !important;
    box-shadow: none !important;
}

.key-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.key-btn.correct {
    background-color: #4ade80 !important;
    /* Green */
    color: white !important;
    border-color: #22c55e !important;
    opacity: 1 !important;
}

.key-btn.wrong {
    background-color: #f87171 !important;
    /* Red */
    color: white !important;
    border-color: #ef4444 !important;
    opacity: 0.8 !important;
}

/* Desktop Optimization for Game */
@media (min-width: 768px) {
    .keyboard-grid {
        max-width: 700px;
        gap: 12px;
    }

    .key-btn {
        font-size: 1.5rem;
        border-radius: 12px;
    }

    .letter-slot {
        max-width: 60px;
        height: 70px;
        font-size: 3rem;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.letter-revealed {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}