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

:root {
    --primary: #a78bfa;
    --primary-dark: #7c3aed;
    --danger: #EF4444;
    --success: #10b981;
    --warning: #F59E0B;
    --bg: #0a0e1a;
    --surface: rgba(20,24,41,.6);
    --card: rgba(30,34,51,.8);
    --text: #e2e8f0;
    --dim: #64748b;
    --spy: #EF4444;
}

html { height: 100%; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0e1a;
    color: var(--text);
    min-height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Hub topbar */
.hub-topbar{position:sticky;top:0;z-index:100;background:rgba(10,14,26,.88);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid rgba(255,255,255,.06);padding:10px 16px}
.hub-home{display:inline-flex;align-items:center;gap:8px;text-decoration:none;color:#a78bfa;font-size:.8rem;font-weight:700;letter-spacing:2px;transition:opacity .2s}
.hub-home:active{opacity:.7}
.hub-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:linear-gradient(135deg,#7c3aed,#3b82f6);border-radius:6px;font-size:.65rem;color:#fff}

.screen { display: none; min-height: 100dvh; padding: 24px 20px; }
.screen.active { display: flex; align-items: center; justify-content: center; }

.container { width: 100%; max-width: 500px; text-align: center; }

.title {
    font-size: 3.5rem; font-weight: 900; letter-spacing: 10px;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 4px;
}
.subtitle { color: var(--dim); font-size: 1rem; margin-bottom: 40px; }

h2 { font-size: 1.5rem; margin-bottom: 24px; }

.menu-buttons { display: flex; flex-direction: column; gap: 14px; }

.btn-primary {
    width: 100%; padding: 18px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 4px 16px rgba(124,58,237,.3);
    color: white; font-size: 1.1rem; font-weight: 700; letter-spacing: 2px; cursor: pointer;
    transition: box-shadow 0.2s, transform 0.1s;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
@media (hover:hover) { .btn-primary:hover { box-shadow: 0 0 24px rgba(124,58,237,.5); } }

.btn-secondary {
    width: 100%; padding: 18px;
    border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
    background: rgba(255,255,255,.04); color: var(--text); font-size: 1.1rem; font-weight: 700;
    letter-spacing: 2px; cursor: pointer;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s, background 0.2s;
}
@media (hover:hover) { .btn-secondary:hover { border-color: rgba(167,139,250,.25); background: rgba(255,255,255,.06); } }

.btn-danger {
    width: 100%; padding: 16px; border: none; border-radius: 12px;
    background: var(--danger); color: white; font-size: 1rem; font-weight: 700;
    letter-spacing: 1px; cursor: pointer; margin-top: 16px;
}

.btn-back {
    background: none; border: none; color: #64748b; font-size: 0.9rem;
    margin-top: 16px; cursor: pointer; padding: 8px;
}

.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; color: var(--dim); font-size: 0.85rem; margin-bottom: 8px; }
.input-group input {
    width: 100%; padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
    background: rgba(255,255,255,.04); color: var(--text);
    font-size: 1.1rem; outline: none;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s;
}
.input-group input:focus { border-color: rgba(124,58,237,.5); }

.stepper { display: flex; align-items: center; justify-content: center; gap: 20px; }
.stepper span { font-size: 1.5rem; font-weight: 700; min-width: 40px; text-align: center; }
.stepper-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--primary);
    background: transparent; color: var(--primary); font-size: 1.4rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.stepper-btn:active { background: var(--primary-dark); color: white; }

.room-code-display {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px; padding: 20px; margin-bottom: 24px;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.room-label { color: var(--dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; }
.room-code { font-size: 3rem; font-weight: 900; letter-spacing: 12px; color: #a78bfa; }

.btn-invite {
    width: 100%; padding: 14px;
    border: 2px dashed rgba(124,58,237,.2); border-radius: 14px;
    background: rgba(124,58,237,.08); color: #a78bfa; font-size: 1rem; font-weight: 700;
    cursor: pointer; margin-bottom: 16px; letter-spacing: 1px;
    transition: background 0.2s;
}
.btn-invite:active { background: rgba(124,58,237,.18); }

.players-list {
    background: rgba(20,24,41,.6); border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px; padding: 12px; margin-bottom: 16px;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.player-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; border-radius: 8px;
}
.player-item:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.05); }
.player-name { font-weight: 600; }
.player-host { font-size: 0.75rem; color: var(--warning); }

.lobby-info { color: var(--dim); font-size: 0.9rem; margin-bottom: 16px; }

.game-topbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.game-topbar .btn-quit {
    background: rgba(20,24,41,.6); border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.score-badge {
    background: rgba(245,158,11,0.15); color: var(--warning); padding: 6px 14px;
    border-radius: 20px; font-size: 0.85rem; font-weight: 700;
}

.role-card {
    background: rgba(20,24,41,.6); border-radius: 20px; padding: 32px; margin-bottom: 20px;
    border: 2px solid rgba(124,58,237,.25); min-height: 200px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(124,58,237,.08);
}
.role-hidden { text-align: center; cursor: pointer; }
.tap-icon { font-size: 3rem; margin-bottom: 12px; }
.role-hidden p { color: var(--dim); font-size: 1rem; }

.role-location {
    font-size: 1.6rem; font-weight: 800; color: #a78bfa; margin-bottom: 12px;
}
.role-location.spy { color: var(--spy); }
.role-divider { height: 2px; background: linear-gradient(90deg, transparent, #7c3aed, transparent); margin-bottom: 12px; }
.role-name { font-size: 1.3rem; font-weight: 600; color: var(--text); }

.game-timer {
    font-size: 2.5rem; font-weight: 900; text-align: center; margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
}
.game-timer.warning { color: var(--danger); animation: pulse 0.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.locations-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    background: rgba(20,24,41,.6); border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; padding: 12px; margin-bottom: 16px;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.loc-item {
    padding: 8px 4px; border-radius: 8px; font-size: 0.75rem; font-weight: 600;
    color: var(--dim); background: rgba(255,255,255,0.03); text-align: center;
}
.loc-item.crossed { text-decoration: line-through; opacity: 0.3; }

.vote-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.vote-item {
    padding: 16px;
    background: rgba(20,24,41,.6); border-radius: 12px;
    font-weight: 600; font-size: 1.1rem; cursor: pointer;
    border: 2px solid rgba(255,255,255,.08);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s, background 0.2s;
}
.vote-item:active { border-color: var(--primary); background: rgba(124,58,237,.1); }
@media (hover:hover) { .vote-item:hover { border-color: rgba(124,58,237,.3); box-shadow: 0 0 12px rgba(124,58,237,.12); } }

.result-emoji { font-size: 4rem; margin-bottom: 12px; }
.result-info {
    background: rgba(20,24,41,.6); border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; padding: 20px; margin-bottom: 20px;
    text-align: left;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.result-row { display: flex; justify-content: space-between; padding: 8px 0; }
.result-row:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.05); }
.result-spy { color: var(--danger); font-weight: 700; }

.pass-card {
    background: rgba(20,24,41,.6); border-radius: 20px; padding: 40px 24px; text-align: center;
    border: 2px solid rgba(124,58,237,.25);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pass-icon { font-size: 4rem; margin-bottom: 16px; }
.pass-card h2 { font-size: 2rem; margin-bottom: 8px; color: var(--primary); }
.pass-card p { color: var(--dim); margin-bottom: 24px; font-size: 1.1rem; }

.phase-icon { text-align: center; }

.toast {
    position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%);
    background: rgba(20,24,41,.8); border: 1px solid rgba(124,58,237,.2);
    padding: 12px 24px; border-radius: 14px; font-size: 0.9rem; color: var(--text);
    transition: bottom 0.3s; z-index: 100;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.toast.show { bottom: 40px; }

/* ===== Ses & animasyon guncellemesi (v13) ===== */
.screen.active { animation: screenIn .3s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.role-revealed { animation: roleFlip .5s ease-out; backface-visibility: hidden; }
@keyframes roleFlip {
  from { transform: perspective(700px) rotateY(90deg); opacity: 0; }
  to { transform: perspective(700px) rotateY(0deg); opacity: 1; }
}

.tap-icon { display: inline-block; animation: tapPulse 1.6s ease-in-out infinite; }
@keyframes tapPulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.2); opacity: 1; } }
.role-hidden { animation: hintGlow 2.2s ease-in-out infinite; border-radius: 16px; }
@keyframes hintGlow { 0%, 100% { box-shadow: 0 0 8px rgba(124,58,237,.12); } 50% { box-shadow: 0 0 22px rgba(124,58,237,.35); } }

.vote-item { animation: voteIn .35s ease-out both; }
@keyframes voteIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
.vote-item:nth-child(1) { animation-delay: 0s; }
.vote-item:nth-child(2) { animation-delay: .05s; }
.vote-item:nth-child(3) { animation-delay: .1s; }
.vote-item:nth-child(4) { animation-delay: .15s; }
.vote-item:nth-child(5) { animation-delay: .2s; }
.vote-item:nth-child(6) { animation-delay: .25s; }
.vote-item:nth-child(7) { animation-delay: .3s; }
.vote-item:nth-child(8) { animation-delay: .35s; }
.vote-item:nth-child(9) { animation-delay: .4s; }
.vote-item:nth-child(10) { animation-delay: .45s; }

.btn-secondary:active, .btn-danger:active, .btn-back:active, .btn-invite:active { transform: scale(.96); }

.confetti-wrap { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 80; }
.confetti-piece { position: absolute; top: -14px; width: 9px; height: 9px; border-radius: 2px; opacity: 0; animation: confettiFall 3s linear forwards; }
@keyframes confettiFall { 0% { opacity: 1; transform: translateY(0) rotate(0deg); } 100% { opacity: .85; transform: translateY(105vh) rotate(560deg); } }

/* Kick butonu (lobi) */
.kick-btn{width:26px;height:26px;border-radius:8px;border:1px solid rgba(239,68,68,.4);background:rgba(239,68,68,.12);color:#f87171;font-size:.75rem;font-weight:800;cursor:pointer;flex-shrink:0;margin-left:auto}
.kick-btn.confirm{background:rgba(239,68,68,.5);color:#fff}
