/* --- iOS 26 CONCEPT THEME --- */
:root {
    --bg-deep: #000000;
    --bg-gradient: radial-gradient(circle at 50% -20%, #0a2e1d 0%, #000000 70%);

    --primary: #34c759; 
    --primary-rgb: 52, 199, 89;
    --danger: #ff453a; 
    
    --glass-heavy: rgba(30, 30, 30, 0.75);
    --glass-light: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --blur-strength: 40px;
    
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.55);
    
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; user-select: none; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }

body { margin: 0; padding: 0; background-color: var(--bg-deep); background-image: var(--bg-gradient); color: var(--text-main); height: 100dvh; width: 100vw; overflow: hidden; display: flex; flex-direction: column; }

.header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; padding-top: calc(12px + var(--safe-top)); z-index: 10; }
.glass-pill { background: var(--glass-light); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 0.5px solid var(--glass-border); border-radius: 100px; padding: 6px 16px 6px 6px; display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.1); transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); }
.glass-pill:active { transform: scale(0.96); background: rgba(255,255,255,0.15); }
.user-ava { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,0.1); }
.user-ava img { width: 100%; height: 100%; object-fit: cover; }
.user-info { display: flex; flex-direction: column; line-height: 1.1; }
.u-label { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; }
.u-name { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.balance-pill { text-align: right; padding: 8px 18px; min-width: 110px; justify-content: flex-end; }
.bal-val { font-size: 17px; font-weight: 700; letter-spacing: -0.5px; }
.bal-lbl { font-size: 11px; font-weight: 600; color: var(--primary); }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; width: 100%; }
.ring-container { position: relative; width: 280px; height: 280px; display: flex; align-items: center; justify-content: center; }
.matte-circle { position: absolute; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.0) 70%); border: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: blur(8px); z-index: 1; }
.glow-fx { position: absolute; width: 120%; height: 120%; border-radius: 50%; background: radial-gradient(circle, rgba(52, 199, 89, 0.25) 0%, transparent 60%); opacity: 0; transition: 0.4s ease; pointer-events: none; z-index: 0; }
.glow-fx.active { opacity: 1; }
.glow-fx.panic { background: radial-gradient(circle, rgba(255, 69, 58, 0.3) 0%, transparent 60%); opacity: 1; }
.svg-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; z-index: 2; }
.ring-track { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 5; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 15px rgba(52, 199, 89, 0.4)); transition: stroke-dashoffset 0.1s linear, stroke 0.3s; }
.center-stats { position: absolute; text-align: center; z-index: 3; display: flex; flex-direction: column; align-items: center; }
.game-id { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 6px; opacity: 0.7; background: rgba(255,255,255,0.06); padding: 3px 8px; border-radius: 8px; }
.pot-lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 2px; margin-bottom: 4px; text-transform: uppercase; }
.pot-val { font-size: 64px; font-weight: 800; letter-spacing: -3px; line-height: 1; background: linear-gradient(180deg, #FFFFFF 40%, rgba(255,255,255,0.6) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.timer-val { margin-top: 12px; font-size: 18px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.feed-wrap { height: 110px; width: 100%; padding: 0 24px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; pointer-events: none; margin-bottom: 16px; mask-image: linear-gradient(transparent, black 50%); -webkit-mask-image: linear-gradient(transparent, black 50%); }
.feed-item { background: rgba(40, 40, 40, 0.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 6px 16px 6px 6px; border-radius: 100px; margin-top: 8px; display: flex; align-items: center; gap: 12px; border: 0.5px solid rgba(255,255,255,0.1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); animation: slideUp 0.4s cubic-bezier(0.17, 0.84, 0.44, 1); }
.log-ava { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; }
.log-ava img { width: 18px; height: 18px; object-fit: contain; }
.log-text { display: flex; flex-direction: column; line-height: 1.1; gap: 1px; }
.log-name { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.log-val { font-size: 14px; font-weight: 600; color: white; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.controls-area { width: 100%; padding: 0 24px; padding-bottom: calc(24px + var(--safe-bottom)); z-index: 20; display: flex; flex-direction: column; gap: 16px; }
.chips-header { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); font-weight: 500; padding: 0 8px; letter-spacing: 0.3px; }
.edit-icon { cursor: pointer; opacity: 0.6; transition: 0.2s; }
.edit-icon:hover { opacity: 1; }
.chips-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { flex: 1; min-width: 64px; height: 56px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(10px); border-radius: 20px; font-size: 17px; font-weight: 600; color: rgba(255,255,255,0.8); cursor: pointer; transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); border: 0.5px solid transparent; }
.chip.active { background: #FFFFFF; color: #000; box-shadow: 0 10px 25px rgba(255,255,255,0.15); transform: translateY(-2px); font-weight: 700; }
.btn-main { width: 100%; height: 72px; background: var(--primary); border: none; border-radius: 28px; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 0.3px; box-shadow: 0 10px 40px rgba(52, 199, 89, 0.35); cursor: pointer; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform 0.1s; }
.btn-main:active { transform: scale(0.97); }
.btn-main:disabled { background: #333; color: #777; box-shadow: none; cursor: not-allowed; }
.sep { opacity: 0.4; font-weight: 300; }

.modal-back { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 99; opacity: 0; pointer-events: none; transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1); display: flex; align-items: flex-end; }
.modal-back.open { opacity: 1; pointer-events: auto; }
.sheet { width: 100%; background: rgba(28, 28, 30, 0.95); backdrop-filter: blur(40px); border-radius: 36px 36px 0 0; border-top: 0.5px solid rgba(255, 255, 255, 0.15); padding: 32px 24px; padding-bottom: calc(40px + var(--safe-bottom)); transform: translateY(100%); transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1); box-shadow: 0 -10px 50px rgba(0,0,0,0.5); }
.modal-back.open .sheet { transform: translateY(0); }
.sheet-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: white; text-align: center; letter-spacing: -0.5px; }

/* DEPOSIT INPUT STYLE */
.deposit-wrap { margin-bottom: 20px; }
#deposit-amount { width: 100%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: white; font-size: 24px; font-weight: 700; text-align: center; padding: 18px; border-radius: 24px; outline: none; transition: 0.2s; }
#deposit-amount:focus { border-color: var(--primary); background: rgba(255,255,255,0.12); }
#deposit-amount::placeholder { color: rgba(255,255,255,0.3); font-weight: 500; }

.profile-header { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 30px; }
.big-ava { width: 90px; height: 90px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.uid { font-size: 13px; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 6px 14px; border-radius: 100px; font-weight: 500; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box { background: rgba(255,255,255,0.05); padding: 16px; border-radius: 24px; text-align: center; border: 0.5px solid rgba(255,255,255,0.05); }
.stat-box.full { grid-column: span 2; }
.stat-val { font-size: 20px; font-weight: 700; color: white; letter-spacing: -0.5px; }
.stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.action-btn { height: 56px; border-radius: 20px; border: none; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: 0.2s; }
.deposit { background: var(--primary); color: #fff; }
.withdraw { background: rgba(255,255,255,0.1); color: #fff; }
.info-text { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 20px; line-height: 1.4; }

.inputs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.chip-input { width: 100%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); color: white; text-align: center; padding: 14px 0; border-radius: 16px; font-weight: 600; font-size: 16px; outline: none; }

/* --- Обновленная шапка --- */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 24px; 
    /* Опускаем на 80px вниз, как просили */
    padding-top: calc(80px + var(--safe-top)); 
    z-index: 10; 
    position: relative;
}

/* Красивое лого по центру */
.logo-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    z-index: 0;
}

.glass-pill { 
    position: relative;
    z-index: 1;
    background: var(--glass-light); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 0.5px solid var(--glass-border); border-radius: 100px; padding: 6px 16px 6px 6px; display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.1); transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); 
}

/* --- Обновленный Feed Item для победителя --- */
.feed-item.winner-item {
    transform: scale(1.1); /* Увеличиваем плашку */
    border: 1px solid rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.2);
    padding: 8px 18px 8px 8px;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
    margin-top: 12px;
    margin-bottom: 4px;
    z-index: 5;
}
.log-name.winner-name {
    color: #FFD700;
    font-size: 13px;
    font-weight: 700;
}

/* --- Стили для Custom Toast Notifications --- */
#toast-container {
    position: fixed;
    top: 30px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 69, 58, 0.6);
    color: #fff;
    padding: 14px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: toastIn 0.3s cubic-bezier(0.17, 0.84, 0.44, 1) forwards, toastOut 0.3s 2.5s cubic-bezier(0.17, 0.84, 0.44, 1) forwards;
}
.toast.success {
    border-color: rgba(52, 199, 89, 0.6);
}

@keyframes toastIn { 
    from { opacity: 0; transform: translateY(-20px) scale(0.9); } 
    to { opacity: 1; transform: translateY(0) scale(1); } 
}
@keyframes toastOut { 
    from { opacity: 1; transform: translateY(0) scale(1); } 
    to { opacity: 0; transform: translateY(-20px) scale(0.9); } 
}