/* games/pismenka/style.css */

/* === CSS Variables (dle graphic_manual.md) === */
:root {
    --pink:    #ff4081;
    --blue:    #40c4ff;
    --yellow:  #ffd740;
    --green:   #4caf50;
    --orange:  #ff9800;
    --purple:  #9c27b0;
    --bg-grad: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --shadow:  0 10px 20px rgba(0,0,0,0.1);
    --radius-card: 24px;
    --radius-btn:  20px;
    --font: 'Nunito', 'Arial Rounded MT Bold', sans-serif;
    --font-serif: 'Lora', serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.header-icon-mini {
    height: 32px;
    width: 32px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: inline-block;
    vertical-align: middle;
}

.btn-toggle {
    width: 80px; height: 80px;
    background: white; border: 4px solid var(--purple); border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); cursor: pointer; transition: transform 0.2s;
    font-size: 2.5rem;
}
.btn-toggle:active { transform: scale(0.9); }
.btn-toggle:disabled { filter: grayscale(1); opacity: 0.7; cursor: not-allowed; transform: scale(0.96); box-shadow: none; }
.btn-toggle img { width: 65%; height: 65%; object-fit: contain; }

body.hint-disabled .slot-ghost {
    opacity: 0 !important;
}

body {
    font-family: var(--font);
    background: var(--bg-grad);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* === Animated background bubbles === */
.stars-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-ball {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    filter: blur(2px);
    will-change: transform;
}


/* === Progress bar === */
.progress-bar-wrap {
    width: 90%;
    max-width: 700px;
    height: 10px;
    background: rgba(0,0,0,0.08);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    z-index: 10;
    margin-bottom: 8px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pink), var(--purple));
    border-radius: 99px;
    width: 0%;
    transition: width 0.5s ease;
}

/* === Game Area === */
.game-area {
    flex: 1;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 140px 16px 16px;
    position: relative;
    z-index: 5;
    gap: 18px;
}

/* === Phases === */
.phase { display: none; flex-direction: column; align-items: center; width: 100%; gap: 20px; }
.phase.active { display: flex; }

/* === Intro phase === */
.word-emoji {
    font-size: clamp(5rem, 18vw, 9rem);
    line-height: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.18));
    animation: emojiPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.word-emoji-small {
    font-size: clamp(5rem, 18vw, 9rem);
    line-height: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.18));
    animation: emojiPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.word-display {
    font-size: clamp(2.6rem, 9vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    animation: slideUp 0.4s 0.1s both;
}

/* === Buttons === */
.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: #fff;
    font-family: var(--font);
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 900;
    border: none;
    border-radius: var(--radius-btn);
    padding: 16px 40px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255,64,129,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.02em;
}
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 12px 32px rgba(255,64,129,0.45); }
.btn-primary:active { transform: scale(0.96); }

.btn-secondary {
    background: rgba(255,255,255,0.85);
    color: #555;
    font-family: var(--font);
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    font-weight: 900;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-btn);
    padding: 14px 32px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.btn-secondary:hover { transform: scale(1.04); }

.pulse {
    animation: pulse 1.8s ease-in-out infinite;
}

/* === Slots Row === */
.slots-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.letter-slot {
    width: clamp(52px, 11vw, 72px);
    height: clamp(52px, 11vw, 72px);
    border-radius: 18px;
    background: rgba(255,255,255,0.7);
    border: 3px solid rgba(0,0,0,0.08);
    box-shadow: inset 0 3px 10px rgba(0,0,0,0.06), var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(4px);
    transition: transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

/* Ghost letter (big-letter shadow hint) */
.slot-ghost {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 900;
    color: rgba(0,0,0,0.12);
    position: absolute;
    pointer-events: none;
    line-height: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Filled letter */
.slot-letter {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 900;
    position: absolute;
    line-height: 1;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.25s, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.letter-slot.filled {
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.letter-slot.filled .slot-ghost { opacity: 0; }
.letter-slot.filled .slot-letter { opacity: 1; transform: scale(1); }

/* Slot fill animation */
.letter-slot.bounce-in {
    animation: slotBounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Shake on wrong */
.letter-slot.shake {
    animation: shake 0.4s;
    border-color: var(--pink);
}

/* === Letter Pool === */
.letter-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: rgba(255,255,255,0.55);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.8);
}

.letter-btn {
    width: clamp(58px, 13vw, 82px);
    height: clamp(58px, 13vw, 82px);
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.2);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18), inset 0 2px 0 rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s;
    animation: letterAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.letter-btn::before {
    content: '';
    position: absolute;
    top: 3px; left: 6px; right: 6px;
    height: 38%;
    background: rgba(255,255,255,0.22);
    border-radius: 12px;
    pointer-events: none;
}
.letter-btn:hover { transform: scale(1.1) translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.22); }
.letter-btn:active { transform: scale(0.94); }
.letter-btn.used {
    background: linear-gradient(135deg,#bdbdbd,#9e9e9e) !important;
    opacity: 0.5;
    transform: scale(0.9);
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

/* === Win phase === */
.win-title {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideUp 0.35s both;
}
.win-subtitle {
    font-size: clamp(1rem, 3.5vw, 1.4rem);
    color: #777;
    animation: slideUp 0.35s 0.1s both;
}
.win-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    animation: slideUp 0.35s 0.2s both;
}

/* === Footer === */
.game-footer {
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    color: #aaa;
    padding: 12px;
    position: relative;
    z-index: 5;
}

/* ===================== */
/* === KEYFRAMES ======= */
/* ===================== */

@keyframes emojiPop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 8px 24px rgba(255,64,129,0.35); }
    50%       { transform: scale(1.04); box-shadow: 0 14px 36px rgba(255,64,129,0.55); }
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    15%     { transform: translateX(-8px); }
    30%     { transform: translateX(8px); }
    45%     { transform: translateX(-6px); }
    60%     { transform: translateX(6px); }
    75%     { transform: translateX(-3px); }
    90%     { transform: translateX(3px); }
}

@keyframes slotBounce {
    0%   { transform: scale(0.7); }
    70%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes letterAppear {
    from { transform: scale(0.5) translateY(10px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* === Responsive tweaks === */
@media (max-width: 480px) {
    .letter-pool { gap: 8px; padding: 12px; }
    .slots-row   { gap: 7px; }
}
