* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
    margin: 0; min-height: 100vh; padding: 14px;
    font-family: Arial, Helvetica, sans-serif; color: white;
    background: radial-gradient(circle at top, #172554 0%, #020617 45%, #00030b 100%);
    overflow-x: hidden;
}
.container { width: 100%; max-width: 560px; margin: auto; position: relative; }

.header { text-align: center; padding: 10px 5px 15px; position: relative; }
.logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; border-radius: 18px;
    background: linear-gradient(135deg, #f43f5e, #fb923c);
    font-size: 30px; box-shadow: 0 10px 35px rgba(244,63,94,.3); margin-bottom: 10px;
}
.header h1 {
    margin: 0; font-size: 31px; letter-spacing: -1px;
    background: linear-gradient(90deg, #f43f5e, #fb923c);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.header p { margin: 5px 0 0; color: #94a3b8; font-size: 13px; }
.mute-btn {
    position: absolute; top: 8px; right: 0;
    background: #172033; border: 1px solid #334155; border-radius: 10px;
    color: white; font-size: 16px; padding: 6px 10px; cursor: pointer; transition: .2s;
}
.mute-btn:active { transform: scale(.9); }
.player { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.player-box { background: rgba(15,23,42,.85); border: 1px solid #1e293b; border-radius: 14px; padding: 11px 5px; text-align: center; }
.player-box small { display: block; color: #64748b; font-size: 9px; margin-bottom: 4px; }
.player-box strong { font-size: 16px; }

.card {
    background: rgba(15,23,42,.94); border: 1px solid rgba(51,65,85,.7);
    border-radius: 24px; padding: 17px; box-shadow: 0 25px 70px rgba(0,0,0,.45);
    margin-bottom: 15px; position: relative; overflow: hidden;
}
.section-title { font-size: 12px; color: #64748b; font-weight: bold; margin: 3px 0 8px; text-transform: uppercase; letter-spacing: 1px; }

.bet-area { background: #0f172a; padding: 12px; border-radius: 14px; margin-bottom: 15px; border: 1px solid #facc15; text-align: center; }
.bet-select { width: 100%; padding: 10px; background: #020617; color: #facc15; border: 1px solid #334155; border-radius: 8px; font-weight: bold; margin-top: 5px; outline: none; }

.lobby-btn {
    width: 100%; border: 0; border-radius: 14px; padding: 15px;
    color: white; font-weight: bold; font-size: 14px; margin-bottom: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 8px 20px rgba(16,185,129,.25); transition: .2s;
}
.lobby-btn:active { transform: scale(.96); }
.lobby-btn:disabled { opacity: .5; cursor: not-allowed; }

.difficulty { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 15px; }
.difficulty button { border: 0; padding: 12px 4px; border-radius: 12px; background: #172033; color: #94a3b8; font-size: 10px; font-weight: bold; transition: .2s; }
.difficulty button.active { background: linear-gradient(135deg, #f43f5e, #fb923c); color: white; box-shadow: 0 7px 20px rgba(244,63,94,.25); }

.info { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 13px; }
.info-box { background: #020617; border-radius: 12px; padding: 11px 4px; text-align: center; }
.info-box small { display: block; color: #64748b; font-size: 8px; margin-bottom: 5px; }
.info-box strong { font-size: 14px; }

.timer-wrap { margin-bottom: 12px; display: none; }
.timer-top { display: flex; justify-content: space-between; color: #f43f5e; font-size: 11px; font-weight: bold; margin-bottom: 5px; }
.timer-bg { width: 100%; height: 10px; background: #020617; border-radius: 10px; overflow: hidden; border: 1px solid #334155; }
.timer-bar { width: 100%; height: 100%; background: linear-gradient(90deg, #f43f5e, #ef4444); transition: width 1s linear, background-color 0.3s; }

.range-card {
    text-align: center; padding: 22px 12px; border-radius: 18px;
    background: linear-gradient(145deg, #071126, #020617); border: 1px solid #1e3a5f; margin-bottom: 13px;
}
.range-label { color: #64748b; font-size: 11px; }
.range-number { margin-top: 6px; color: #38bdf8; font-size: 32px; font-weight: bold; }
.range-hint { color: #94a3b8; font-size: 11px; margin-top: 8px; min-height: 16px;}

.input-area { display: flex; gap: 8px; margin-top: 15px;}
input {
    flex: 1; min-width: 0; border: 2px solid #273449; outline: none;
    background: #020617; color: white; border-radius: 14px; padding: 15px;
    font-size: 18px; text-align: center; transition: .2s;
}
input:focus { border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.15); }
input:disabled { opacity: 0.4; cursor: not-allowed; border-color: #1e293b; background: #0b1120; }

.guess-btn {
    width: 105px; border: 0; border-radius: 14px; color: white; font-weight: bold;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 8px 20px rgba(244,63,94,.25); transition: .2s;
}
.guess-btn:active { transform: scale(.96); }
.guess-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 8px; }
.action { border: 0; border-radius: 11px; padding: 12px 4px; background: #172033; color: #cbd5e1; font-size: 11px; font-weight: bold; transition: .2s; }
.action:active { transform: scale(0.95); }
.action.shop-btn { background: linear-gradient(135deg, #d97706, #b45309); color: white; }

.message { min-height: 56px; display: flex; align-items: center; justify-content: center; text-align: center; margin-top: 10px; padding: 12px; border-radius: 14px; background: #020617; border: 1px solid #172033; color: #cbd5e1; font-size: 13px; font-weight: bold; transition: .3s; }
.temperature { text-align: center; margin-top: 9px; min-height: 20px; color: #64748b; font-size: 11px; }

.taunt-area { display: none; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 10px; padding: 8px; background: #020617; border-radius: 12px; border: 1px dashed #1e293b; }
.taunt-btn { background: transparent; border: 0; font-size: 22px; cursor: pointer; transition: .2s; }
.taunt-btn:active { transform: scale(0.8); }
.floating-emoji { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 100px; z-index: 100; pointer-events: none; animation: floatUp 2s forwards ease-out; opacity: 0; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 80% { opacity: 1; transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -100%) scale(0.8); } }

.history { margin-top: 18px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.history-title { font-size: 13px; font-weight: bold; }
.history-count { color: #64748b; font-size: 10px; }
.history-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 35px; }
.history-item { padding: 8px 10px; border-radius: 9px; background: #172033; font-size: 11px; color: #cbd5e1; }
.history-item.low { border-left: 3px solid #38bdf8; }
.history-item.high { border-left: 3px solid #f97316; }
.history-item.correct { border-left: 3px solid #22c55e; background: rgba(34,197,94,.12); }
.history-item.mine { background: #1e3a8a; }

.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 16px; }
.stat { text-align: center; background: #020617; border-radius: 11px; padding: 10px 3px; }
.stat strong { display: block; color: #38bdf8; font-size: 16px; }
.stat small { color: #475569; font-size: 8px; }

.modal { position: fixed; inset: 0; z-index: 99; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.82); backdrop-filter: blur(6px); }
.modal.show { display: flex; }
.modal-box { width: 100%; max-width: 350px; text-align: center; padding: 20px; border-radius: 20px; background: linear-gradient(145deg, #111c31, #020617); border: 1px solid #26364f; box-shadow: 0 30px 100px rgba(0,0,0,.6); animation: popup .25s ease; }
@keyframes popup { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 44px; margin-bottom: 8px; }
.modal-title { font-size: 22px; font-weight: bold; margin-bottom: 6px; }
.modal-text { font-size: 13px; color: #cbd5e1; line-height: 1.6; }

.shop-item { display: flex; justify-content: space-between; align-items: center; background: #0f172a; padding: 12px; border-radius: 12px; margin-bottom: 8px; border: 1px solid #1e293b; text-align: left;}
.shop-icon { font-size: 24px; margin-right: 10px; }
.shop-desc strong { display: block; font-size: 13px; color: #38bdf8;}
.shop-desc small { font-size: 10px; color: #94a3b8; }
.shop-buy { background: #10b981; border: 0; border-radius: 8px; color: white; font-weight: bold; font-size: 11px; padding: 8px 12px; cursor: pointer; }
.shop-buy.use { background: #3b82f6; }
.shop-buy:disabled { background: #475569; opacity: 0.5; }
.close-modal { margin-top: 15px; width: 100%; border: 0; border-radius: 10px; padding: 12px; background: #334155; color: white; font-weight: bold; cursor: pointer; }

#blindOverlay { position: absolute; inset: 0; background: black; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; border-radius: 24px;}
#blindOverlay.active { opacity: 1; pointer-events: all; }
#blindOverlay h2 { color: #f43f5e; font-size: 24px; margin-bottom: 5px; }
#blindOverlay p { color: white; font-size: 12px; }

.shake { animation: shake .3s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.win { animation: win .5s; }
@keyframes win { 50% { transform: scale(1.02); } }
.flash { animation: flash 0.6s; }
@keyframes flash { 0% { background-color: rgba(56, 189, 248, 0.7); transform: scale(1.05); } 100% { background-color: transparent; transform: scale(1); } }
.frozen { animation: freezeEffect 1s infinite alternate; }
@keyframes freezeEffect { 0% { border-color: #38bdf8; box-shadow: 0 0 10px #38bdf8; } 100% { border-color: #60a5fa; box-shadow: 0 0 20px #60a5fa; } }
.panic-time { animation: panicPulse 0.5s infinite alternate; }
@keyframes panicPulse { 0% { box-shadow: 0 0 0px #f43f5e; } 100% { box-shadow: 0 0 15px #f43f5e; } }

#gameCard { display: none; }

.numpad { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 8px; }
.numpad button { border: 0; border-radius: 10px; padding: 10px; background: #172033; color: #cbd5e1; font-size: 14px; font-weight: bold; transition: .2s; }
.numpad button:active { transform: scale(0.95); }
.numpad button.primary { background: linear-gradient(135deg, #f43f5e, #e11d48); color: white; }

#customToggle { width: auto; flex: none; padding: 0; border: 0; accent-color: #f43f5e; }
.custom-field { display: flex; flex-direction: column; gap: 4px; }
.custom-field small { color: #64748b; font-size: 9px; font-weight: bold; letter-spacing: .5px; }
#customArea input { padding: 8px; font-size: 13px; flex: none; width: 100%; }
