@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:wght@400;600&display=swap');

:root{
    --bg: #C2742C;
    --panel: #17145C;
    --accent: #04BF45;
    --muted: darkgray;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
    --radius-large: 1.5rem;
}

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

html,body{
    height:100%;
}

body{
    background-color:var(--bg);
    font-family:var(--font-sans);
    -webkit-font-smoothing:antialiased;
    text-align:center;
    padding: 2rem 1rem;
}

main{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:1.5rem;
    width:100%;
}

.container{
    margin-top:6vh;
    width:100%;
    display:flex;
    justify-content:center;
    padding: 0 1rem;
}

.heading-container{
    width:100%;
    max-width:900px;
    display:flex;
    justify-content:center;
}

.heading{
    padding-top:1.5rem;
    width:100%;
    max-width:720px;
}

h4{
    display:inline-block;
    background-color:var(--panel);
    color:#fff;
    /* font-family:var(--font-serif); */
    font-weight:600;
    font-size:clamp(1.25rem, 2.5vmin, 2rem);
    padding:0.75rem 1.25rem;
    border-radius:2rem;
    letter-spacing:0.6px;
    text-transform:capitalize;
    text-shadow:0 2px 6px rgba(0,0,0,0.25);
}

.game-container{
    width:100%;
    display:flex;
    justify-content:center;
    padding: 0 1rem;
}

.game{
    width:min(560px, 92%);
    background-color:var(--panel);
    border-radius:1.5rem;
    padding:1.5rem;
    color:#fff;
    box-shadow:0 8px 24px rgba(0,0,0,0.15);
}

.game p{
    color:#fff;
    padding:0.5rem 0 1rem 0;
    font-size:clamp(0.95rem, 2.2vmin, 1.15rem);
    letter-spacing:0.2px;
    line-height:1.35;
}

#user-guess{
    width:100%;
    max-width:420px;
    padding:0.8rem 1rem;
    border-radius:999px;
    border:none;
    font-size:1rem;
    font-family:var(--font-sans);
    background-color:rgba(255,255,255,0.06);
    color:#fff;
    backdrop-filter: blur(4px);
}

.btn-container{
    margin-top:1.25rem;
    display:flex;
    justify-content:center;
    gap:0.75rem;
    flex-wrap:wrap;
}

.btn{
    padding:0.6rem 1rem;
    border-radius:12px;
    border:none;
    min-width:120px;
    flex:1 1 140px;
    max-width:220px;
    font-weight:700;
    font-size:1rem;
    font-family:var(--font-sans);
    letter-spacing:0.4px;
    text-transform:uppercase;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 120ms ease, filter 120ms ease;
    will-change: transform, box-shadow;
}

#guess-btn{ background-color:var(--accent); }
#guess-btn:hover{ background-color:#039C38; cursor:pointer; filter:brightness(1.02); transform:translateY(-3px); box-shadow:0 10px 24px rgba(3,156,56,0.22); }

#reset-btn{ background-color:var(--muted); }
#reset-btn:hover{ background-color:gray; cursor:pointer; transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,0.18); }

.btn:active{ transform:translateY(0) scale(0.995); }
.btn:focus{ outline: none; box-shadow:0 0 0 4px rgba(4,191,69,0.12); }
.btn:focus-visible{ outline: 3px solid rgba(255,255,255,0.12); outline-offset:3px; }

/* Input hover/focus styling */
#user-guess{
    width:100%;
    max-width:420px;
    padding:0.8rem 1rem;
    border-radius:999px;
    border:none;
    font-size:1rem;
    transition: box-shadow 180ms ease, transform 140ms ease, background-color 120ms ease;
}

#user-guess:hover{ box-shadow:0 6px 18px rgba(0,0,0,0.08); }
#user-guess:focus{ outline:none; box-shadow:0 12px 30px rgba(4,191,69,0.18); transform:translateY(-2px); }
#user-guess:focus-visible{ outline:3px solid rgba(4,191,69,0.14); outline-offset:3px; }

.result-container{ margin-top:1rem; }
.result{ padding:0.75rem 0; }
.result p{
    color:#fff;
    font-size:clamp(1rem, 2.8vmin, 1.5rem);
    font-weight:700;
    /* font-family:var(--font-serif); */
    letter-spacing:0.3px;
    text-shadow:0 3px 12px rgba(0,0,0,0.25);
}

/* Styled start/hint message inside result */
.result .start-message{
    display:inline-block;
    background:linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    color:#fff;
    padding:0.45rem 0.9rem;
    border-radius:999px;
    border:1px solid rgba(255,255,255,0.06);
    box-shadow:0 8px 22px rgba(0,0,0,0.22);
    font-family:var(--font-sans);
    font-weight:600;
    font-size:clamp(0.95rem, 2.6vmin, 1.15rem);
    letter-spacing:0.6px;
    text-transform:capitalize;
    transition:transform 160ms ease, box-shadow 160ms ease, filter 120ms ease;
}
.result .start-message:hover{
    /* transform:translateY(-3px); */
    box-shadow:0 14px 36px rgba(0,0,0,0.28);
    filter:brightness(1.03);
}
.result .start-message:focus{
    outline:none;
    box-shadow:0 0 0 6px rgba(4,191,69,0.08);
}

/* Small screens adjustments */
@media (max-width:420px){
    body{ padding:1.25rem 0.5rem; }
    .heading{ padding-top:0.75rem; }
    h4{ font-size:1.1rem; padding:0.5rem 0.9rem; }
    .game{ padding:1rem; border-radius:1rem; }
    .btn{ min-width:100px; font-size:0.95rem; }
    #user-guess{ padding:0.7rem; }
}

/* Larger screens: tighten layout */
@media (min-width:900px){
    .container{ margin-top:10vh; }
    .game{ padding:2rem; }
}

/* Very small / narrow phones: make buttons half the width of the input */
@media (max-width:320px){
    .btn-container{ gap:0.5rem; }
    .btn{
        flex: 0 0 calc(50% - 0.25rem);
        max-width: calc(50% - 0.25rem);
        min-width: 0;
    }
}

/* Achievement container (hidden until unlocked) */
.achievement{
    margin-top:1rem;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:0.6rem;
}

.badge{
    background: linear-gradient(90deg,#ffd966,#ff9f1c);
    color: #262626;
    padding:0.5rem 1rem;
    border-radius:999px;
    font-weight:700;
    box-shadow:0 12px 30px rgba(0,0,0,0.18);
    transform: scale(0.85) translateY(8px);
    opacity:0;
}

.funny-message{
    background: rgba(255,255,255,0.03);
    color:#fff;
    padding:0.4rem 0.8rem;
    border-radius:8px;
    font-weight:600;
    font-size:0.95rem;
    opacity:0;
    transform: translateY(6px);
}

/* Animations for achievement reveal */
@keyframes badge-in {
    from { transform: scale(0.75) translateY(12px); opacity:0; }
    60% { transform: scale(1.08) translateY(-6px); opacity:1; }
    to { transform: scale(1) translateY(0); opacity:1; }
}
@keyframes message-in {
    from { transform: translateY(10px); opacity:0; }
    to { transform: translateY(0); opacity:1; }
}

.achievement.show .badge{
    animation: badge-in 700ms cubic-bezier(.2,.9,.2,1) forwards;
}
.achievement.show .funny-message{
    animation: message-in 420ms ease 380ms forwards;
}

/* --- Embed/video UI styling (appended) --- */
.video-area{ display:flex; justify-content:center; margin-top:18px; }
.embed-box{
    width:100%; max-width:780px; background:linear-gradient(180deg,#ffffff,#f7fbff);
    border-radius:14px; padding:14px; box-shadow:0 18px 40px rgba(14,30,60,0.08);
    border:4px solid rgba(31,110,235,0.08);
}
.embed-controls{ display:flex; gap:8px; align-items:center; margin-bottom:10px; flex-wrap:wrap }
.embed-input{ flex:1 1 320px; padding:8px 10px; border-radius:8px; border:1px solid #dbeafe; font-size:14px }
.embed-play{ background:#1f6feb; color:#fff; border:none; padding:9px 12px; border-radius:8px; cursor:pointer }
.embed-iframe{ width:100%; height:400px; border-radius:10px; border:3px solid #c7e0ff; }
.embed-note{ color:#475569; font-size:13px; margin-bottom:8px }

.hidden{ display:none }

/* Countdown overlay for 3,2,1 animation */
.countdown-overlay{
    position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
    background:rgba(2,6,23,0.5); z-index:1200; pointer-events:none;
}
.countdown-number{
    font-size:120px; color:#fff; font-weight:800; text-shadow:0 12px 40px rgba(2,6,23,0.6);
    transform:scale(0.6); opacity:0; animation:count-pop 900ms ease forwards;
}
@keyframes count-pop{
    0% { transform:scale(0.6); opacity:0 }
    30% { transform:scale(1.05); opacity:1 }
    70% { transform:scale(0.95); opacity:0.9 }
    100% { transform:scale(0.6); opacity:0 }
}