* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0;
}

body {
    background-color: #080b12;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

/* Strict Zero-Scroll and Full-Screen Viewport Fit */
body.bomb-game-body {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100vw !important;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body.danger-zone {
    animation: panicRedFlash 0.3s infinite alternate ease-in-out;
}

body.exploding {
    animation: megaShake 0.4s ease-in-out;
}

/* Modal Setup & End Cards */
.setup-card, .explode-card {
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.25rem 1.4rem;
    width: 90vw;
    max-width: 440px;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    margin: auto;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    animation: zoomIn 0.3s ease-out;
    z-index: 10;
}

@media (max-width: 600px) {
    .setup-card, .explode-card {
        width: 92vw;
        max-width: 360px;
        padding: 1rem;
    }
}

.setup-card h1 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.section-title {
    text-align: center;
    font-size: 1.15rem;
    color: #f59e0b;
    margin-bottom: 0.25rem;
}

label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
}

select {
    width: 100%;
    padding: 0.55rem 0.8rem;
    margin-top: 0.2rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #0f172a;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
}

/* Dynamic Player Selector Box */
.players-selection-container {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
    margin: 0.35rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.player-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.55);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
}

.player-checkbox-row input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #f59e0b;
}

.compass-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.4rem auto;
    width: 100%;
}

/* Fluid Sizing for Compass Circle */
.compass-circle {
    position: relative;
    width: min(70vw, 40vh); 
    height: min(70vw, 40vh);
    max-width: 350px;
    max-height: 350px;
    border: 2px dashed rgba(245, 158, 11, 0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08), transparent 70%);
}

.compass-center-dot {
    font-size: 1.3rem;
    pointer-events: none;
}

.player-node {
    position: absolute;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.5);
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.player-node.active-target {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 0 20px rgba(239, 68, 68, 1);
    transform: translate(-50%, -50%) scale(1.22) !important;
}

.player-arrow {
    position: absolute;
    width: 18px;
    height: 18px;
    font-size: 1rem;
    color: rgba(245, 158, 11, 0.45);
    font-weight: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);
    transition: color 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.player-arrow.active-arrow {
    color: #ef4444;
    filter: drop-shadow(0 0 8px #ef4444);
    animation: arrowPulse 0.35s infinite alternate;
}

/* Scaled Responsive Arena Container */
.gameplay-container {
    width: 95vw;
    height: 95dvh;
    max-width: 800px; 
    max-height: 800px;
    background: radial-gradient(circle, rgba(22, 31, 48, 0.95) 0%, rgba(11, 15, 25, 0.98) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: auto;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
    cursor: pointer;
    overflow: hidden;
}

/* Extra-Large Danger Overlay */
.danger-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(
        circle at center, 
        rgba(239, 68, 68, 0.75) 0%, 
        rgba(185, 28, 28, 0.55) 55%, 
        rgba(127, 29, 29, 0.95) 100%
    );
    box-shadow: inset 0 0 120px rgba(239, 68, 68, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 5;
}

body.danger-zone .danger-overlay {
    opacity: 1;
}

.timer-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.3);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    font-size: 1.15rem;
    font-weight: 900;
    padding: 0.3rem 1.1rem;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.55);
    z-index: 30;
}

.timer-badge.fly-top {
    animation: flyToTop 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.top-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    z-index: 25;
}

.badge-pool {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    padding: 0.25rem 0.65rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-quit {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #94a3b8;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Fluid Sizing for Arena Circle */
.arena-circle {
    position: relative;
    width: min(80vw, 65vh);
    height: min(80vw, 65vh);
    max-width: 600px;
    max-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

/* Percentage based Core */
.rotating-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 55%; 
    height: 55%;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    transition: transform 0.65s cubic-bezier(0.34, 1.45, 0.7, 1);
    z-index: 10;
}

.bomb-graphic {
    font-size: 2.2rem;
    margin-bottom: 0.05rem;
    transition: transform 0.1s ease;
}

@media (max-width: 600px) {
    .bomb-graphic {
        font-size: 1.8rem;
    }
}

.bomb-graphic.ticking-fast {
    animation: franticShake 0.12s infinite;
}

.prompt-box {
    text-align: center;
}

.prompt-label {
    font-size: 0.6rem;
    color: #94a3b8;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.05rem;
}

.syllable-display {
    font-size: 1.8rem;
    font-weight: 900;
    color: #f59e0b;
    letter-spacing: 2px;
    line-height: 1.1;
    animation: popIn 0.25s ease;
}

@media (max-width: 600px) {
    .syllable-display {
        font-size: 1.4rem;
    }
}

.turn-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: #38bdf8;
    margin-top: 0.15rem;
}

.tap-hint {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 0.05rem;
}

/* Explosion Centering & Fullscreen White Shockwave Flash */
.explosion-flash {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
}

.explosion-flash.active {
    animation: flashBang 0.7s ease-out forwards;
}

.shockwave {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 80px !important;
    height: 80px !important;
    transform: translate(-50%, -50%) scale(0);
    border: 8px solid #ffffff;
    box-shadow: 0 0 35px #ef4444, inset 0 0 25px #ef4444;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
}

.shockwave.active {
    animation: shockwaveExpand 0.75s ease-out forwards;
}

.explode-card {
    text-align: center;
    position: relative;
}

.explosion-icon {
    font-size: 3.5rem;
    animation: popOut 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.explode-card h2 {
    font-size: 1.8rem;
    color: #ef4444;
    font-weight: 900;
    margin: 0.1rem 0;
}

.loser-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 0.4rem;
}

.punishment-box {
    background: rgba(239, 68, 68, 0.14);
    border: 1.5px dashed #ef4444;
    border-radius: 12px;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.punishment-label {
    font-size: 0.7rem;
    color: #fca5a5;
    font-weight: 800;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.2rem;
}

.punishment-text {
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.35;
}

.btn-action {
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-bomb {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    margin-top: 0.75rem;
}

.btn-secondary {
    background: #334155;
    color: #cbd5e1;
    margin-top: 0.35rem;
}

.btn-action:active {
    transform: scale(0.97);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes flyToTop {
    0% { top: 50%; left: 50%; transform: translate(-50%, -50%) scale(1.3); }
    100% { top: 0.6rem; left: 50%; transform: translate(-50%, 0) scale(0.95); }
}

@keyframes franticShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-5px, 3px) rotate(-8deg); }
    75% { transform: translate(5px, -3px) rotate(8deg); }
}

@keyframes megaShake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-10px, 6px); }
    40% { transform: translate(10px, -6px); }
    60% { transform: translate(-6px, 4px); }
    80% { transform: translate(6px, -4px); }
}

@keyframes shockwaveExpand {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(10); opacity: 0; }
}

@keyframes arrowPulse {
    from { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    to { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
}

@keyframes panicRedFlash {
    from { background-color: #080b12; }
    to { background-color: #450a0a; }
}

@keyframes flashBang {
    0% { opacity: 0.95; }
    100% { opacity: 0; }
}

@keyframes popOut {
    0% { transform: scale(0.3); opacity: 0; }
    80% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}