/* ============================================
   EXIT GAME — Esküvői csapatjáték
   Stílus: rusztikus, letisztult, kraft paper
   ============================================ */

:root {
    --color-bg: #fdfaf3;            /* nagyon halvány meleg fehér */
    --color-paper: #f4ecd8;         /* halvány sárga papír */
    --color-kraft: #c9a87c;         /* kraft paper alap szín */
    --color-kraft-dark: #8a6a3f;
    --color-text: #1a1a1a;
    --color-text-soft: #4a4a4a;
    --color-error: #a8412e;
    --color-success: #4a6b3a;
    --color-line: #2a2a2a;

    --font-serif: 'Martel', Georgia, serif;
    --font-script: 'MonteCarlo', 'Martel', cursive;

    --radius: 4px;
    --shadow-soft: 0 2px 12px rgba(60, 40, 20, 0.08);
    --shadow-card: 0 4px 24px rgba(60, 40, 20, 0.12);
}

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

html, body {
    min-height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Háttér — ha vissza akarod hozni a kraft textúrát, tedd be az
   assets/kraft.png-t és uncomment-eld a background-image sort lent. */
body {
    background-color: var(--color-bg);
    /* background-image: url('assets/kraft.png'); */
    /* background-size: 400px auto; */
    /* background-repeat: repeat; */
    /* background-blend-mode: multiply; */
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px;
    position: relative;
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* ============================================
   FONTOK / CÍMEK
   ============================================ */

.title-script {
    font-family: var(--font-script);
    font-weight: 400;
    font-size: clamp(2.6rem, 9vw, 4rem);
    line-height: 1;
    color: var(--color-text);
    letter-spacing: 0.5px;
}

.subtitle {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 1rem;
    color: var(--color-text-soft);
    letter-spacing: 0.4px;
    text-align: center;
    margin-top: 8px;
}

/* ============================================
   HOME — csapatválasztó
   ============================================ */

.home-header {
    text-align: center;
    padding: 16px 0 28px;
}

.home-header .title-script {
    text-align: center;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.team-tile {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(42, 42, 42, 0.12);
    border-radius: var(--radius);
    padding: 10px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.team-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    background: rgba(255, 255, 255, 0.95);
}

.team-tile:active {
    transform: translateY(0);
}

.team-tile.completed {
    background: rgba(244, 236, 216, 0.85);
    border-color: var(--color-kraft);
}

.team-tile img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

@media (min-width: 520px) {
    .team-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (min-width: 720px) {
    .team-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================
   GAME — kódbevitel
   ============================================ */

.game-card,
.success-card,
.seating-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(42, 42, 42, 0.1);
    border-radius: var(--radius);
    padding: 28px 22px;
    margin-top: 48px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.team-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.team-badge img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.team-badge span {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.game-title {
    font-family: var(--font-script);
    font-weight: 400;
    font-size: clamp(2.2rem, 8vw, 3rem);
    color: var(--color-text);
    margin-bottom: 6px;
}

.game-instruction {
    font-size: 0.95rem;
    color: var(--color-text-soft);
    margin-bottom: 24px;
}

.code-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.code-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.digit {
    width: 64px;
    height: 80px;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 2.2rem;
    text-align: center;
    border: 2px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-paper);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
    caret-color: var(--color-text);
    -moz-appearance: textfield;
}

.digit::-webkit-outer-spin-button,
.digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.digit:focus {
    border-color: var(--color-kraft-dark);
    background: #fff;
}

.code-form.shake .digit {
    animation: shake 0.4s ease;
    border-color: var(--color-error);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.primary-btn {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.8px;
    padding: 14px 32px;
    border: 2px solid var(--color-line);
    border-radius: var(--radius);
    background: var(--color-line);
    color: var(--color-bg);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    text-transform: uppercase;
    min-width: 200px;
}

.primary-btn:hover {
    background: var(--color-bg);
    color: var(--color-line);
}

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

.error-message {
    color: var(--color-error);
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 1.4em;
    margin-top: 6px;
}

/* ============================================
   BACK BUTTON
   ============================================ */

.back-btn {
    position: absolute;
    top: 18px;
    left: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(42, 42, 42, 0.15);
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-text);
    font-size: 1.4rem;
    font-family: var(--font-serif);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    transition: background 0.15s ease;
    z-index: 10;
}

.back-btn:hover {
    background: #fff;
}

/* ============================================
   SUCCESS
   ============================================ */

.success-mark {
    width: 80px;
    height: 80px;
    border: 3px solid var(--color-success);
    border-radius: 50%;
    color: var(--color-success);
    font-size: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.success-text {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--color-text);
    margin: 12px 0 26px;
}

/* ============================================
   SEATING
   ============================================ */

.seating-card {
    padding-top: 36px;
}

.seating-intro {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--color-text-soft);
    margin: 12px 0 22px;
}

.seating-image-wrap {
    position: relative;
    background-color: var(--color-paper);
    background-image: url('assets/seating/kraft.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border: 1px solid rgba(138, 106, 63, 0.25);
    border-radius: var(--radius);
    padding: 14px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seating-image-wrap img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

.seating-image-wrap img[hidden] { display: none; }

.seating-placeholder {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-text-soft);
    text-align: center;
    padding: 40px 16px;
}
