/* games/hangman.css */
body, html { margin: 0 !important; padding: 0 !important; overflow: hidden !important; }
footer, .site-footer, #main-footer, .footer, .mobile-bottom-nav, #mobile-floating-bell, .floating-bell-wrapper { 
    display: none !important; 
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#game-wrapper {
    position: fixed; inset: 0; z-index: 50; background: #0f172a; overflow: hidden; color: white; user-select: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; display: flex; flex-direction: column;
}

/* ANIMOWANE TŁO (Skopiowane i dopasowane z Asteroid Blaster) */
#stars-bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none; background-color: #050810;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(219, 39, 119, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.15) 0%, transparent 40%),
        radial-gradient(1px 1px at 10% 10%, #fff, transparent),
        radial-gradient(2px 2px at 80% 40%, rgba(219, 39, 119, 0.4), transparent);
    background-size: 100% 100%; animation: space-subtle-pulse 20s ease-in-out infinite alternate;
}
@keyframes space-subtle-pulse { 0% { transform: scale(1); filter: brightness(1); } 100% { transform: scale(1.05); filter: brightness(1.2); } }

/* EKRANY I MENU */
.overlay-screen { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.9); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 15px; backdrop-filter: blur(5px); }
.menu-card { background: #1e293b; border-radius: 20px; border: 2px solid #334155; box-shadow: 0 0 50px rgba(0,0,0,0.8); display: flex; flex-direction: column; max-width: 600px; width: 100%; overflow: hidden; max-height: 95vh; }
.card-controls-bar { width: 100%; display: flex; justify-content: flex-start; padding: 10px 20px; background: #0f172a; border-bottom: 1px solid #334155; }
.control-btn { background: #334155; border: none; color: white; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; transition: 0.2s; }
.control-btn:hover { background: #475569; transform: scale(1.1); }
.card-content { padding: 30px; display: flex; flex-direction: column; align-items: center; text-align: center; overflow-y: auto; }

.mode-selector { display: flex; gap: 10px; margin-bottom: 20px; width: 100%; background: #0f172a; padding: 5px; border-radius: 12px; }
.mode-btn { flex: 1; padding: 10px; font-weight: bold; border-radius: 8px; border: none; background: transparent; color: #94a3b8; cursor: pointer; transition: 0.3s;}
.mode-btn.active { background: #db2777; color: white; }

.rounds-selector { margin-bottom: 20px; width: 100%; }
.time-btns { display: flex; gap: 8px; justify-content: center; }
.t-btn { flex: 1; padding: 10px; font-weight: bold; border-radius: 8px; background: #334155; color: #cbd5e1; border: none; cursor: pointer;}
.t-btn.active { background: #fde047; color: #0f172a; }

.player-profile-wrapper, .group-naming-area { display: flex; align-items: center; background: #0f172a; border: 2px solid #334155; border-radius: 50px; padding: 5px 15px; width: 100%; margin-bottom: 20px; gap: 10px;}
.group-naming-area { flex-direction: column; background: transparent; border: none; padding: 0;}
.group-input-wrapper { display: flex; width: 100%; background: #0f172a; border: 2px solid #334155; border-radius: 50px; padding: 10px 15px;}
.name-input, .group-name-input { border: none; background: transparent; color: white; outline: none; font-size: 1rem; font-weight: bold; width: 100%; text-align: center;}
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; background: #475569; color: white; flex-shrink: 0; }
.btn-start { background: linear-gradient(135deg, #db2777, #be185d); box-shadow: 0 5px 20px rgba(219, 39, 119, 0.4); border: none; color: white; padding: 15px 40px; font-size: 1.2rem; font-weight: 900; border-radius: 50px; cursor: pointer; transition: 0.2s; width: 100%; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0;}
.btn-start:hover { transform: translateY(-3px) scale(1.05); }

/* Odliczanie */
#countdown-screen { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }
.vs-title { font-size: clamp(1.2rem, 3vh, 1.5rem); color: #94a3b8; font-weight: bold; margin-bottom: 10px; }
.vs-teams-container { display: flex; align-items: center; justify-content: center; gap: 20px; }
.team-anim { font-size: clamp(1.5rem, 4vh, 2.5rem); font-weight: 900; text-transform: uppercase; text-shadow: 2px 2px 0 #000; }
.vs-badge { font-size: clamp(2rem, 6vh, 4rem); color: #ef4444; font-style: italic; font-weight: 900; }
#count-number { font-size: clamp(3.5rem, 15vw, 10rem); margin: 0; text-shadow: 0 0 20px currentColor; font-weight: 900; line-height: 1; }
@keyframes popScale { 0% { transform: scale(0.5); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* UI GRY - Turowy model z panelem drużyn na górze */
.game-board-container { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 60px 10px 10px 10px; max-width: 1400px; margin: 0 auto; width: 100%; box-sizing: border-box; position: relative; z-index: 10; }

.volume-group { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.vol-slider { width: 80px; accent-color: #38bdf8; cursor: pointer; }

.game-header-hud { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 100; pointer-events: none; }
.game-header-hud .control-btn { pointer-events: auto; }
.round-badge { position: absolute; left: 50%; transform: translateX(-50%); background: rgba(15,23,42,0.8); border: 1px solid #334155; padding: 5px 20px; border-radius: 20px; font-weight: 900; color: #94a3b8; font-size: 1.2rem; pointer-events: auto; }
.round-badge span { color: #38bdf8; }

.teams-hud-wrapper { display: flex; justify-content: center; gap: 60px; width: 100%; margin-bottom: 25px; }

.team-panel { flex: 1; max-width: 600px; display: flex; flex-direction: column; align-items: center; position: relative; transition: 0.3s; opacity: 1; }
.team-panel.dead-team { opacity: 0.4; filter: grayscale(100%); }

.team-header { font-size: 1.4rem; font-weight: 900; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.team-blue .team-header { color: #38bdf8; }
.team-pink .team-header { color: #db2777; }

/* Boxy z wynikiem i szubienicą obok siebie */
.team-boxes-container { display: flex; gap: 20px; width: 100%; justify-content: center; align-items: stretch; }
.team-sub-box { flex: 1; background: rgba(30,41,59,0.5); border: 2px solid #334155; border-radius: 15px; padding: 15px; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: 0.3s; min-height: 180px; }

.team-blue.active-turn .team-sub-box { border-color: #38bdf8; background: rgba(56, 189, 248, 0.1); box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); transform: scale(1.03); }
.team-pink.active-turn .team-sub-box { border-color: #db2777; background: rgba(219, 39, 119, 0.1); box-shadow: 0 0 20px rgba(219, 39, 119, 0.4); transform: scale(1.03); }

.dramatic-death .team-sub-box { animation: shakeDeath 0.6s cubic-bezier(.36,.07,.19,.97) both; border-color: #ef4444 !important; box-shadow: 0 0 30px #ef4444 !important; background: rgba(239, 68, 68, 0.2) !important; }
@keyframes shakeDeath {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
  40%, 60% { transform: translate3d(8px, 0, 0); }
}

.score-label { font-size: 1.1rem; color: #cbd5e1; font-weight: bold; letter-spacing: 2px; margin-bottom: 5px; }
.team-score span { font-weight: 900; color: white; font-size: 4.5rem; text-shadow: 0 0 15px rgba(255,255,255,0.2); }

.hangman-mini-section { height: 180px; display: flex; justify-content: center; width: 100%; }
.gallows-svg { height: 100%; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); }
.hm-part { 
    display: block; 
    stroke-dasharray: 200; 
    stroke-dashoffset: 200; 
    transition: stroke-dashoffset 0.4s ease-in-out; 
}
.hm-part.drawn {
    stroke-dashoffset: 0 !important;
}

.shared-play-area { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* ZAGADKI I LITERY */
.clue-section { text-align: center; margin-bottom: 12px; background: rgba(30, 41, 59, 0.7); padding: 10px 20px; border-radius: 15px; border: 1px solid #334155; width: 95%; max-width: 1300px; }
.clue-text { margin: 0; font-size: clamp(1.4rem, 2.8vh, 2rem); font-weight: 600; line-height: 1.25; color: #f8fafc; }

.word-section { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; row-gap: clamp(10px, 2vh, 20px); margin-bottom: clamp(15px, 4vh, 35px); }
.word-group { display: flex; flex-wrap: nowrap; gap: 8px; }
.letter-box { width: clamp(20px, min(4.5vw, 5vh), 65px); height: clamp(30px, min(6vw, 7vh), 85px); border-bottom: clamp(3px, 0.6vh, 6px) solid #cbd5e1; display: flex; justify-content: center; align-items: flex-end; font-size: clamp(1.4rem, min(3.5vw, 4.5vh), 4rem); font-weight: 900; color: transparent; text-transform: uppercase; transition: 0.3s; padding-bottom: 4px; }
.letter-box.revealed { color: #f8fafc; border-bottom-color: #10b981; animation: popLetter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.letter-box.missed-letter { color: #f87171; border-bottom-color: #ef4444; }
.symbol-box { display: flex; justify-content: center; align-items: flex-end; font-size: clamp(1.4rem, min(3.5vw, 4.5vh), 4rem); font-weight: 900; color: #f8fafc; padding-bottom: 7px; width: auto; min-width: 15px; }
.word-space { width: clamp(15px, 3vw, 35px); height: 10px; }

/* KLAWIATURA */
.keyboard-wrapper { width: 100%; display: flex; flex-direction: column; align-items: center; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
body.team-mode-active .keyboard-wrapper.turn-a { transform: translateX(-15vw); }
body.team-mode-active .keyboard-wrapper.turn-b { transform: translateX(15vw); }

.keyboard-section { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 900px; }
.keyboard-row { display: flex; justify-content: center; gap: 10px; width: 100%; }

.key-btn { background: #334155; border: 2px solid #475569; border-radius: 10px; color: white; font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: bold; width: clamp(35px, 5vw, 65px); height: clamp(45px, 7vw, 75px); cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; padding: 0; }
.key-special { background: #1e293b; border-color: #38bdf8; color: #38bdf8; } /* Wyróżnienie znaków diakrytycznych */
.key-btn:hover:not(:disabled) { background: #475569; transform: translateY(-3px); }
.key-btn.correct { background: #10b981; border-color: #059669; color: white !important; }
.key-btn.wrong { background: #1e293b; border-color: #334155; color: #64748b !important; opacity: 0.5; }
.key-btn:disabled { cursor: not-allowed; }

/* PŁYWAJĄCE PUNKTY I ANIMACJE */
.floating-pts { position: absolute; font-size: 4.5rem; font-weight: 900; pointer-events: none; animation: floatUp 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; z-index: 100; text-shadow: 3px 3px 0 #000, 0 0 20px currentColor; top: 30%; left: 50%; transform: translateX(-50%); }
@keyframes floatUp { 0% { opacity: 1; transform: translate(-50%, 0) scale(0.5); } 20% { transform: translate(-50%, -30px) scale(1.4); } 100% { opacity: 0; transform: translate(-50%, -100px) scale(1.8); } }

@keyframes popScale { 0% { transform: scale(1); } 50% { transform: scale(1.8); } 100% { transform: scale(1); } }

/* WYNIKI I PANELE */
.menu-right { flex: 0.8; padding: 30px; background: rgba(15, 23, 42, 0.6); border-left: 2px solid #334155; display: flex; flex-direction: column; }
.hof-title { font-size: 1.2rem; color: #fde047; text-align: center; margin-top: 0; margin-bottom: 15px; text-transform: uppercase; }
.hof-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1; max-height: 280px; }
.hof-list::-webkit-scrollbar { width: 6px; }
.hof-list::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.hof-item { display: flex; justify-content: space-between; padding: 10px; background: #1e293b; border-radius: 8px; margin-bottom: 8px; color: #cbd5e1; border: 1px solid #334155; font-weight: bold; }
.hof-item span:nth-child(2) { color: #38bdf8; background: rgba(56, 189, 248, 0.1); padding: 2px 8px; border-radius: 6px; }
.hof-item.rank-0 { border-color: #eab308; color: #fef08a; background: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(15, 23, 42, 1)); }

/* RESPONSYWNOŚĆ I ZABEZPIECZENIA MOBILNE */
@media (max-width: 768px) {
    .card-content { flex-direction: column !important; }
    .menu-left { padding: 20px !important; border-right: none !important; }
    .menu-right { border-left: none; border-top: 2px dashed #334155; padding: 20px !important; width: 100%; box-sizing: border-box;}
    #end-screen .menu-left { border-bottom: 2px dashed #334155; }
    
    .teams-hud-wrapper { gap: 10px; margin-bottom: 10px; margin-top: 15px; flex-direction: column; }
    .team-panel { max-width: 100%; width: 100%; padding: 5px; }
    .team-boxes-container { gap: 8px; }
    .team-sub-box { padding: 8px; min-height: 100px; }
    
    .team-header { font-size: 1rem; }
    .score-label { font-size: 0.7rem; }
    .team-score span { font-size: 2rem; }
    .hangman-mini-section { height: 90px; }
    
    .game-header-hud { padding: 0 10px; }
    .round-badge { padding: 4px 12px; font-size: 1rem; }
    .vol-slider { width: 50px; }
    
    body.team-mode-active .keyboard-wrapper.turn-a { transform: translateX(-5vw); }
    body.team-mode-active .keyboard-wrapper.turn-b { transform: translateX(5vw); }
}

@media (max-height: 800px) {
    .game-board-container { padding-top: 45px; padding-bottom: 5px; }
    .teams-hud-wrapper { margin-bottom: 10px; gap: 15px; }
    .team-sub-box { padding: 10px; min-height: 110px; }
    .hangman-mini-section { height: 100px; }
    .team-score span { font-size: 2.5rem; }
    .clue-section { margin-bottom: 8px; padding: 5px 15px; width: 98%; max-width: none; }
    .clue-text { font-size: clamp(0.9rem, 2.2vh, 1.4rem); }
    .word-section { margin-bottom: clamp(10px, 2vh, 15px); gap: 6px; row-gap: clamp(6px, 1.5vh, 10px); }
    .word-group { gap: 6px; }
    .letter-box { width: clamp(18px, min(3.5vw, 4vh), 45px); height: clamp(25px, min(5vw, 5.5vh), 60px); font-size: clamp(1.2rem, min(3vw, 3.5vh), 2.5rem); border-bottom-width: clamp(2px, 0.4vh, 4px); }
    .symbol-box { font-size: clamp(1.2rem, min(3vw, 3.5vh), 2.5rem); }
    .word-space { width: 15px; }
    .keyboard-section { gap: clamp(4px, 1vh, 8px); max-width: 700px; }
    .keyboard-row { gap: clamp(4px, 1vh, 8px); }
    .key-btn { width: clamp(28px, min(4.5vw, 5vh), 48px); height: clamp(35px, min(6vw, 6vh), 55px); font-size: clamp(0.9rem, min(1.8vw, 2.5vh), 1.3rem); }
}