@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@200;300;400&display=swap');
:root {
    --bg: #F2F2F7;
    --white: #fff;
    --dark: #1C1C1E;
    --gray: #8E8E93;
    --coral: #FA7F7B;
    --coral-deep: #F2615D;
    --purple: #7B61D9;
    --purple-light: #A792FA;
    --purple-deep: #6A5ACD;
    --blue: #7879FF;
    --gold: #EADA5F;
    --font: 'Inter', -apple-system, sans-serif;
    --r: 24px;
}
body.dark-theme {
    --bg: #0D0D12;
    --white: #222226;
    --dark: #FFFFFF;
    --gray: #A1A1A6;
    --bg-soft: #333338;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { height: 100dvh; }
body { margin: 0; padding: 0; width: 100%; height: 100dvh; overflow: hidden; font-family: var(--font); background: var(--bg); color: var(--dark); -webkit-tap-highlight-color: transparent; }
/* ═══════════ LOGIN SCREEN ═══════════ */
.login-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: #0D0D12;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s, transform 0.6s cubic-bezier(.32,.72,0,1);
}
.login-screen::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(123,97,217,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 80%, rgba(250,127,123,0.08) 0%, transparent 50%);
}
.login-screen.hidden { opacity: 0; transform: scale(1.05); pointer-events: none; }
.login-screen:not(.hidden) ~ .ios-tab-bar { display: none !important; }
.login-container { text-align: center; position: relative; z-index: 1; padding: 40px; }
.login-logo { margin-bottom: 24px; animation: loginFloat 4s ease-in-out infinite; }
@keyframes loginFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.login-title { font-size: 42px; font-weight: 900; color: #fff; letter-spacing: -1px; margin-bottom: 8px; }
.login-subtitle { font-size: 16px; color: rgba(255,255,255,0.45); font-weight: 500; margin-bottom: 48px; letter-spacing: 2px; text-transform: uppercase; }
.google-btn {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 16px 32px; border-radius: 16px; border: none;
    background: #fff; color: #333; font-family: var(--font);
    font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: all 0.25s;
}
.google-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.google-btn:active { transform: scale(0.97); }
.login-skip {
    margin-top: 24px; color: rgba(255,255,255,0.3);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: color 0.2s;
}
.login-skip:hover { color: rgba(255,255,255,0.6); }
/* Мобилка — 100% ширина, без чёрных полос */
.phone-frame { width: 100%; margin: 0; padding: calc(24px + env(safe-area-inset-top)) 20px calc(100px + env(safe-area-inset-bottom)); min-height: 100dvh; position: relative; }
/* ═══════════ HEADER ═══════════ */
.header { margin-bottom: 24px; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.date-wrap { position: relative; }
.date-badge { background: var(--white); border: none; padding: 8px 14px; border-radius: 20px; font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--dark); display: flex; align-items: center; gap: 6px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: 0.2s; }
.date-badge svg { transition: transform 0.3s; }
.date-badge.open svg { transform: rotate(180deg); }
.date-dropdown { position: absolute; top: calc(100% + 6px); left: 0; background: var(--white); border-radius: 16px; padding: 6px; min-width: 160px; box-shadow: 0 12px 40px rgba(0,0,0,0.12); z-index: 10; opacity: 0; transform: translateY(-8px) scale(0.96); pointer-events: none; transition: all 0.25s cubic-bezier(.32,.72,0,1); }
.date-dropdown.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dd-item { padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; cursor: pointer; transition: 0.15s; }
.dd-item:hover, .dd-item.active { background: var(--bg); }
.dd-item.active { color: var(--purple); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.xp-pill { background: var(--dark); color: var(--gold); padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; transition: transform 0.3s; border: none; font-family: var(--font); cursor: pointer; }
.xp-pill:active { transform: scale(0.93); }
.xp-pill.bump { animation: xpBump 0.4s; }
@keyframes xpBump { 50% { transform: scale(1.15); } }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1a2a4a, #4a6a9c); border: 2px solid var(--white); box-shadow: 0 4px 12px rgba(0,0,0,0.1); cursor: pointer; overflow: hidden; position: relative; }
.user-avatar:active { transform: scale(0.93); }
.greeting { font-size: 48px; font-weight: 700; letter-spacing: -2px; line-height: 1; }
/* Rank Popup */
.rank-popup {
    display: none; background: var(--white); border-radius: 20px;
    padding: 20px 24px; box-shadow: 0 16px 50px rgba(0,0,0,0.12);
    position: absolute; right: 20px; top: 50px; z-index: 20; min-width: 220px;
    animation: popIn 0.25s cubic-bezier(.32,.72,0,1);
}
.rank-popup.open { display: block; }
@keyframes popIn { from{opacity:0;transform:translateY(-8px) scale(0.95)} to{opacity:1;transform:translateY(0) scale(1)} }
.rp-title { font-size: 12px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.rp-rank { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.rp-bar-wrap { height: 8px; background: #eee; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.rp-bar { height: 100%; background: linear-gradient(90deg, var(--gold), #F2AD41); border-radius: 8px; transition: width 0.6s cubic-bezier(.4,0,.2,1); width: 0%; }
.rp-next { font-size: 12px; color: var(--gray); font-weight: 600; }
/* ═══════════ CARD STACK ═══════════ */
.card-stack { position: relative; height: 300px; margin-bottom: 20px; width: 100%; display: flex; justify-content: center; }
.task-card {
    position: absolute; width: 420px; max-width: 90vw; height: 240px;
    border-radius: var(--r); color: #fff;
    transform-origin: center bottom;
    will-change: transform, opacity;
    cursor: pointer; overflow: visible;
    transition: transform 0.7s cubic-bezier(.32,.72,0,1),
                opacity 0.7s cubic-bezier(.32,.72,0,1),
                box-shadow 0.7s cubic-bezier(.32,.72,0,1),
                left 0.7s cubic-bezier(.32,.72,0,1);
}
.task-card.pos-0 { z-index: 3; transform: translateY(50px) translateX(8px) rotate(-1.5deg) scale(1); }
.task-card.pos-1 { z-index: 2; transform: translateY(20px) translateX(0px) rotate(-4deg) scale(0.96); }
.task-card.pos-2 { z-index: 1; transform: translateY(-8px) translateX(-8px) rotate(-7deg) scale(0.92); }
.card-inner {
    position: absolute; inset: 0; border-radius: var(--r);
    padding: 20px; display: flex; flex-direction: column;
    justify-content: space-between; transition: transform 0.15s;
}
.task-card:active .card-inner { transform: scale(0.98); }
/* Breathing and Peek hints */
.task-card.pos-0 .card-inner { animation: breathe0 5s ease-in-out infinite; }
.task-card.pos-1 .card-inner { animation: peekHint 5s ease-in-out infinite 1s; }
.task-card.pos-2 .card-inner { animation: peekHint 5s ease-in-out infinite 2.5s; }
@keyframes breathe0 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes peekHint { 
    0%, 100% { transform:translateY(0); } 
    8% { transform:translateY(-20px) translateX(-8px) rotate(3deg) scale(1.02); } 
    16% { transform:translateY(0); } 
}
.task-card.coral-card .card-inner { background: linear-gradient(135deg, #FA9D9A, #F2615D); }
.task-card.purple-card .card-inner { background: linear-gradient(135deg, #C0B3FA, #8E7DF0); }
.task-card.dark-card .card-inner { background: linear-gradient(135deg, #555, #333); }
.task-card.green-card .card-inner { background: linear-gradient(135deg, #7DD99A, #4CAF50); }
.task-card.coral-card { box-shadow: 0 16px 40px rgba(242,97,93,0.30); }
.task-card.purple-card { box-shadow: 0 12px 30px rgba(167,146,250,0.25); }
.task-card.dark-card { box-shadow: 0 12px 30px rgba(0,0,0,0.15); }
.task-card.green-card { box-shadow: 0 12px 30px rgba(76,175,80,0.25); }
.task-card.fly-left { animation: flyLeft 0.7s cubic-bezier(.32,.72,0,1) forwards !important; pointer-events: none; }
@keyframes flyLeft { 0%{transform:translate(8px, 50px) rotate(-1.5deg) scale(1);opacity:1} 30%{transform:translate(-30%,-8px) rotate(-10deg) scale(1.02);opacity:1} 100%{transform:translate(-140%,-30px) rotate(-18deg) scale(0.88);opacity:0} }
.task-card.fly-right { animation: flyRight 0.7s cubic-bezier(.32,.72,0,1) forwards !important; pointer-events: none; }
@keyframes flyRight { 0%{transform:translate(8px, 50px) rotate(-1.5deg) scale(1);opacity:1} 30%{transform:translate(30%,-8px) rotate(10deg) scale(1.02);opacity:1} 100%{transform:translate(140%,-30px) rotate(18deg) scale(0.88);opacity:0} }
.c-top { display: flex; align-items: center; gap: 8px; }
.c-icon { opacity: 0.9; flex-shrink: 0; }
.c-title { font-size: 17px; font-weight: 600; flex: 1; }
.c-badges { display: flex; gap: 6px; flex-shrink: 0; }
.badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-priority { background: rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.3); color: #fff; backdrop-filter: blur(4px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.badge-tag { background: var(--gold); color: #333; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 12px 0; }
.c-grid-item { display: flex; flex-direction: column; gap: 4px; }
.c-grid-label { font-size: 12px; opacity: 0.7; font-weight: 500; }
.c-grid-val { font-size: 13px; font-weight: 600; }
.c-bottom { display: flex; align-items: center; justify-content: space-between; }
.mini-avatars { display: flex; align-items: center; }
.mini-av { width: 28px; height: 28px; border-radius: 50%; margin-right: -8px; border: 2px solid rgba(255,255,255,0.5); }
.mini-av:nth-child(1){background:#3a5a8c}.mini-av:nth-child(2){background:#fff}.mini-av:nth-child(3){background:var(--gold)}
.mini-count { margin-left: 12px; font-size: 13px; font-weight: 600; }
.card-action-btn { padding: 10px 20px; border-radius: 20px; background: var(--white); color: var(--dark); border: none; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: 0.15s; }
.card-action-btn:active { transform: scale(0.95); }
.empty-state { display:flex; align-items:center; justify-content:center; height:100%; color:var(--gray); font-weight:600; font-size:18px; animation: fadeUp 0.4s; }
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
/* ═══════════ WIDGETS ═══════════ */
.widgets-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.widget { background: var(--white); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; height: 180px; box-shadow: 0 4px 16px rgba(0,0,0,0.03); position: relative; overflow: hidden; cursor: pointer; transition: transform 0.2s; }
.widget:active { transform: scale(0.98); }
.w-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.w-label { font-size: 15px; font-weight: 500; color: var(--dark); }
.animated-check .check-ring { stroke-dasharray: 100; stroke-dashoffset: 100; animation: drawRing 1.2s ease-out forwards 0.3s; }
@keyframes drawRing { to { stroke-dashoffset: 0; } }
.w-big { font-size: 40px; font-weight: 700; letter-spacing: -2px; margin: auto 0 12px; }
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-track { flex:1; height: 8px; background: #eee; border-radius: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--coral), var(--purple-light)); transition: width 0.6s cubic-bezier(.4,0,.2,1); width: 0%; }
.pct { font-size: 12px; font-weight: 600; color: var(--gray); min-width: 30px; text-align: right; }
.premium-focus { background: linear-gradient(135deg, #1A1A24 0%, #2D2A4A 100%); overflow: hidden; position: relative; }
.premium-glow { position: absolute; right: -20px; top: -30px; width: 140px; height: 140px; background: radial-gradient(circle, rgba(167,146,250,0.4) 0%, transparent 70%); border-radius: 50%; filter: blur(8px); animation: orbFloat 8s ease-in-out infinite; pointer-events: none; }
@keyframes orbFloat { 0%,100%{transform:translate(0,0) scale(1);opacity:.8} 33%{transform:translate(-8px,6px) scale(1.08);opacity:1} 66%{transform:translate(4px,-4px) scale(.95);opacity:.7} }
.focus-info { margin: auto 0 12px; position: relative; z-index:2; }
.fi-name { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.fi-meta { font-size: 12px; color: var(--gray); }
.premium-btn { width: 100%; padding: 12px; border-radius: 20px; background: linear-gradient(90deg, #A792FA, #FA7F7B); border: none; font-family: var(--font); font-size: 14px; font-weight: 700; color: #fff; cursor: pointer; position: relative; z-index: 2; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 15px rgba(167,146,250,0.3); }
.premium-btn:active { transform: scale(0.95); box-shadow: 0 2px 8px rgba(167,146,250,0.2); }
.goals-widget { background: var(--white); border-radius: var(--r); padding: 18px; margin-top: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.03); }
.goals-widget .dc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.goals-widget .dc-title { font-size: 16px; font-weight: 700; color: var(--dark); }
.goal-text[contenteditable="true"] { outline: none; border-bottom: 1px dashed transparent; flex: 1; transition: 0.2s; padding: 2px 0; }
.goal-text[contenteditable="true"]:focus { border-bottom: 1px dashed rgba(0,0,0,0.3); }
/* ═══════════ SCREENS ═══════════ */
.screen { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.visible { display: block; animation: screenIn 0.4s cubic-bezier(.32,.72,0,1); }
@keyframes screenIn { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
/* ═══════════ STATS — DASHBOARD COPY (LIGHT THEME) ═══════════ */
.dash-frame { background: var(--bg); min-height: 100%; padding: calc(env(safe-area-inset-top) + 24px) 24px 80px; color: var(--dark); border-radius: inherit; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.dash-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.dash-profile { display: flex; align-items: center; gap: 12px; }
.dash-profile img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #e0e0e0; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.dash-card { background: var(--white); border-radius: 20px; padding: 20px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(0,0,0,0.03); }
.dash-card.white-card { background: var(--white); color: var(--dark); }
.dc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.dc-title { font-size: 16px; font-weight: 700; color: var(--dark); }
.white-card .dc-title { color: var(--dark); }
/* Stats entrance animations */
.dash-card { opacity: 0; transform: translateY(24px); transition: opacity 0.6s, transform 0.6s cubic-bezier(.32,.72,0,1); }
.dash-card.anim-in { opacity: 1; transform: translateY(0); }
.ov-dot { transform: scale(0); transition: transform 0.3s, background 0.3s; }
.ov-dot.anim-in { transform: scale(1); }
.wp-bar { transition: height 0.8s cubic-bezier(.32,.72,0,1) !important; }
.goal-item { opacity: 0; transform: translateX(-12px); transition: opacity 0.4s, transform 0.4s cubic-bezier(.32,.72,0,1); }
.goal-item.anim-in { opacity: 1; transform: translateX(0); }
/* Overall Info */
.ov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 24px; }
.ov-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.ov-num { font-size: 28px; font-weight: 800; line-height: 1; color: var(--dark); }
.ov-label { font-size: 10px; color: var(--gray); line-height: 1.3; text-align: center; opacity: 0.9; font-weight: 600; }
.ov-dots { display: flex; justify-content: space-between; overflow: hidden; margin-bottom: 24px; padding: 0 4px; }
.ov-dot { width: 6px; height: 6px; border-radius: 50%; background: #e0e0e0; transition: background 0.3s; }
.ov-dot.fill-yellow { background: #FCC934; box-shadow: 0 2px 4px rgba(252,201,52,0.3); }
.ov-dot.fill-red { background: #FF5252; box-shadow: 0 2px 4px rgba(255,82,82,0.3); }
.ov-dot.fill-green { background: #5BB974; box-shadow: 0 2px 4px rgba(91,185,116,0.3); }
.ov-blocks { display: flex; gap: 12px; }
.ov-block { flex: 1; border-radius: 14px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--dark); gap: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.ov-block strong { font-size: 22px; font-weight: 800; margin-top: 2px; line-height: 1; }
.ov-block span { font-size: 11px; font-weight: 600; opacity: 0.8; }
.ov-block.yellow { background: #FCC934; color: #18191B; }
.ov-block.red { background: #FF5252; color: #fff; }
.ov-block.green { background: #5BB974; color: #fff; }
/* Grid for desktop layout */
.dash-grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
/* Weekly Progress */
.wp-badge { background: #FCC934; color: #18191b; font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 6px; }
.wp-bars { display: flex; justify-content: space-between; align-items: flex-end; height: 110px; margin-bottom: 16px; }
.wp-bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.wp-track { width: 14px; height: 85px; background: #E8EAED; border-radius: 8px; overflow: hidden; display: flex; align-items: flex-end; border: 1px solid #DADCE0; }
.wp-fill { width: 100%; background: #FCC934; border-radius: 6px; transition: height 0.8s cubic-bezier(.32,.72,0,1); }
.wp-label { font-size: 11px; font-weight: 600; color: #9AA0A6; }
.wp-sport-dot { font-size: 12px; font-weight: 600; color: var(--dark); display: flex; align-items: center; gap: 8px; margin-top: 4px; }
/* Month Progress */
.month-prog-card { position: relative; }
.mp-row { display: flex; align-items: center; gap: 16px; margin: 12px 0; }
.mp-left-text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.mp-left-text strong { font-size: 36px; font-weight: 900; color: var(--dark); line-height: 1; }
.mp-left-text span { font-size: 13px; color: var(--gray); font-weight: 600; margin-top: 2px; }
.mp-badge-inline { background: #FCC934; color: #000; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; display: flex; flex-direction: column; text-align: center; line-height: 1.2; margin-top: 10px; box-shadow: 0 4px 10px rgba(252,201,52,0.3); }
.mp-badge-inline small { font-size: 8px; font-weight: 600; opacity: 0.8; margin-top: 2px; }
.mp-ring-wrap { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.mp-ring-wrap svg { display: block; width: 130px; height: 130px; }
.mp-legend { display: flex; justify-content: center; gap: 16px; margin-top: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.yellow { background: #FCC934; }
.dot.green { background: #5BB974; }
.dot.red { background: #FF5252; }
.mp-legend div { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--gray); font-weight: 600; }
/* Goals Checklists — Premium */
.g-count { font-size: 11px; background: linear-gradient(135deg, #A792FA, #7B61D9); padding: 4px 10px; border-radius: 12px; color: #fff; margin-left: 8px; font-weight: 700; letter-spacing: 0.3px; }
.goals-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.goal-item {
    display: flex; align-items: center; gap: 14px; cursor: pointer;
    background: var(--white); border-radius: 14px; padding: 14px 16px;
    border-left: 3px solid #A792FA;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(.32,.72,0,1);
}
.goal-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-1px); }
.goal-item input { display: none; }
.checkmark { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #D0D0D5; position: relative; display: flex; align-items: center; justify-content: center; transition: all 0.25s; flex-shrink: 0; }
.goal-item:hover .checkmark { border-color: #A792FA; }
.goal-item.checked { border-left-color: #5BB974; background: rgba(91,185,116,0.1); opacity: 0.7; }
.goal-item.checked .checkmark { border-color: #5BB974; background: #5BB974; }
.goal-item.checked .checkmark::after { content: ''; width: 6px; height: 10px; border-bottom: 2px solid #fff; border-right: 2px solid #fff; transform: rotate(45deg) translateY(-1px); }
.goal-text { font-size: 14px; color: var(--dark); font-weight: 600; transition: 0.2s; outline: none; line-height: 1.4; }
.goal-item.checked .goal-text { color: var(--gray); text-decoration: line-through; }
.del-goal-btn { background: none; border: none; font-size: 18px; color: #D0D0D5; cursor: pointer; transition: color 0.2s; padding: 4px 8px; border-radius: 8px; flex-shrink: 0; }
.del-goal-btn:hover { color: #FF4A5A; background: rgba(255,74,90,0.08); }
/* ═══════════ НАТИВНЫЙ TAB BAR (КАК В MEDIA KASSA) ═══════════ */
.ios-tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-around; align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 8px 10px 16px;
    z-index: 100;
}
body.dark-theme .ios-tab-bar {
    background: rgba(24, 25, 27, 0.95);
    border-top: 1px solid rgba(255,255,255,0.08);
}
.tab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: none; border: none; padding: 4px; gap: 4px;
    color: var(--gray); cursor: pointer; transition: 0.2s; width: 64px;
}
.tab-item svg { transition: transform 0.2s; }
.tab-item span { font-size: 10px; font-weight: 600; line-height: 1; }
.tab-item.active { color: var(--dark); }
.tab-item:active svg { transform: scale(0.9); }
.tab-fab {
    display: flex; justify-content: center; align-items: center;
    background: none; border: none; padding: 0; margin-top: -16px; cursor: pointer; width: 64px;
}
.fab-inner {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--coral); color: #fff;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 4px 14px rgba(250,127,123,0.4); transition: transform 0.2s;
}
.tab-fab:active .fab-inner { transform: scale(0.9); }
/* ═══════════ FOCUS TIME CHIPS ═══════════ */
.focus-time-chip {
    padding: 10px 20px; border-radius: 14px; border: 2px solid #E8EAED;
    background: var(--white); color: var(--dark); font-family: var(--font);
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.focus-time-chip.selected {
    background: var(--purple); color: #fff; border-color: var(--purple);
    box-shadow: 0 4px 14px rgba(123,97,217,0.3);
}
.focus-time-chip.optimal {
    background: #5BB974; color: #fff; border-color: #5BB974;
    box-shadow: 0 4px 14px rgba(91,185,116,0.4);
}
.focus-time-chip:active { transform: scale(0.95); }
.focus-task-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--bg); border-radius: 14px; cursor: pointer;
    transition: all 0.2s; border: 2px solid transparent;
}
.focus-task-item:active { transform: scale(0.98); }
.focus-task-item.selected { border-color: var(--purple); background: rgba(123,97,217,0.08); }
.focus-task-item .fti-color { width: 8px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.focus-task-item .fti-title { font-size: 15px; font-weight: 600; color: var(--dark); }
.focus-task-item .fti-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }
/* ═══════════ MODALS ═══════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 300; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.half-sheet { width: 100%; max-width: 430px; background: var(--white); border-radius: 28px 28px 0 0; padding: 16px 24px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; height: 85dvh; overflow-y: auto; transform: translateY(100%); transition: transform 0.5s cubic-bezier(.32,.72,0,1); }
.modal-overlay.open .half-sheet { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: rgba(0,0,0,0.15); margin: 0 auto 4px; flex-shrink:0; }
.half-sheet h2 { font-size: 22px; font-weight: 700; }
.half-sheet label { font-size: 13px; font-weight: 600; color: var(--gray); }
.field { width: 100%; padding: 14px 16px; border-radius: 12px; border: none; background: var(--bg); font-family: var(--font); font-size: 15px; font-weight: 500; outline: none; transition: 0.2s box-shadow; }
.field:focus { box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1); }
.create-task-btn { width: 100%; padding: 18px; border-radius: 20px; background: var(--dark); color: var(--white); border: none; font-family: var(--font); font-size: 16px; font-weight: 700; letter-spacing: 0.5px; cursor: pointer; text-transform: uppercase; transition: 0.15s; margin-top: auto; }
.create-task-btn:active { transform: scale(0.97); opacity: 0.9; }
/* Priority Color Picker */
.priority-picker { display: flex; gap: 10px; justify-content: space-between; }
.pp-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; padding: 8px 4px; border-radius: 14px; flex: 1;
    transition: all 0.2s; border: 2px solid transparent;
}
.pp-item.active { border-color: var(--dark); background: rgba(0,0,0,0.03); }
.pp-item:active { transform: scale(0.93); }
.pp-dot { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,0.15); transition: transform 0.2s; }
.pp-item.active .pp-dot { transform: scale(1.15); }
.pp-item span { font-size: 10px; font-weight: 700; color: var(--gray); }
.pp-item.active span { color: var(--dark); }
/* History Items */
.hist-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg); padding: 14px 16px; border-radius: 16px;
    margin-bottom: 8px; cursor: pointer; transition: 0.2s;
}
.hist-item:active { transform: scale(0.98); }
.hist-color { width: 4px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.hist-info { flex: 1; }
.hist-info strong { font-size: 14px; display: block; margin-bottom: 2px; }
.hist-info span { font-size: 12px; color: var(--gray); }
.hist-check { color: #5BB974; flex-shrink: 0; }
/* Focus picker tasks — красивые с синей кнопкой Play */
.fp-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: #fff; margin-bottom: 12px; cursor: pointer; transition: all 0.25s; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 2px solid transparent; }
.fp-item:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.05); }
.fp-item:active { transform: scale(0.98); }
.fp-color { width: 4px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.fp-info { flex: 1; }
.fp-info strong { font-size: 15px; display: block; margin-bottom: 3px; color: #161619; }
.fp-info span { font-size: 12px; color: var(--gray); font-weight: 500; }
.fp-play {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    position: relative; overflow: visible;
}
.fp-play::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid #3B82F6; opacity: 0;
    animation: playPulseBlue 2s ease-out infinite;
}
@keyframes playPulseBlue { 0%{transform:scale(0.8);opacity:0} 30%{opacity:0.6} 100%{transform:scale(1.4);opacity:0} }
@keyframes spin { 100%{transform:rotate(360deg)} }
/* ═══════════ FULLSCREEN FOCUS ═══════════ */
.focus-fullscreen {
    position: fixed; inset: 0; z-index: 500;
    background: #5939B0;
    display: none; flex-direction: column;
    align-items: center; justify-content: center; color: #fff;
    /* Увеличиваем высоту и убираем поля, чтобы точно покрыть весь экран на iOS */
    top: -50px; bottom: -50px; left: 0; right: 0; padding: 50px 0;
}
.focus-fullscreen.active { display: flex; animation: focusFade 0.6s cubic-bezier(.32,.72,0,1); }
@keyframes focusFade { from{opacity:0;transform:scale(1.04)} to{opacity:1;transform:scale(1)} }
.focus-header {
    position: absolute; top: max(20px, env(safe-area-inset-top));
    left: 0; right: 0; padding: 0 20px;
    display: flex; align-items: center; justify-content: center;
}
.focus-task-pill {
    background: rgba(255,255,255,0.12); padding: 10px 20px; border-radius: 20px;
    font-size: 14px; font-weight: 600; backdrop-filter: blur(12px);
    max-width: 70%; line-height: 1.3; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.focus-close:active { transform: translateX(-50%) scale(0.9) !important; }
.focus-body { text-align: center; padding: 0 24px; }
.focus-subtitle { font-size: 14px; font-weight: 600; opacity: 0.5; margin-bottom: 16px; letter-spacing: 2px; text-transform: uppercase; }
.focus-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 80px; font-weight: 400; letter-spacing: -2px;
    line-height: 1; margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 60px rgba(255,255,255,0.2);
}
.focus-ticks { display: flex; gap: 5px; align-items: center; justify-content: center; margin-bottom: 24px; }
.focus-ticks span {
    width: 3px; height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    transform-origin: bottom;
    animation: tickSmooth 3s cubic-bezier(0.4, 0.0, 0.2, 1) infinite alternate;
}
.focus-ticks span.tick-center { background: rgba(255,255,255,0.4); animation-duration: 2s; }
.focus-ticks span:nth-child(1),.focus-ticks span:nth-child(11){animation-delay:0s}
.focus-ticks span:nth-child(2),.focus-ticks span:nth-child(10){animation-delay:0.2s}
.focus-ticks span:nth-child(3),.focus-ticks span:nth-child(9){animation-delay:0.4s}
.focus-ticks span:nth-child(4),.focus-ticks span:nth-child(8){animation-delay:0.6s}
.focus-ticks span:nth-child(5),.focus-ticks span:nth-child(7){animation-delay:0.8s}
.focus-ticks span:nth-child(6){animation-delay:1.0s}
@keyframes tickSmooth {
    0%   { transform: scaleY(0.4); opacity: 0.15; }
    100% { transform: scaleY(1.3); opacity: 0.7; }
}
.focus-assistant { margin-top: 0; }
.fa-bubble {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    padding: 10px 18px; border-radius: 16px;
    font-size: 13px; font-weight: 500;
    backdrop-filter: blur(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    max-width: 260px; letter-spacing: 0.2px;
}
.dots-loader:after {
    content: '';
    animation: dotsCycle 1.4s infinite;
}
@keyframes dotsCycle {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
.fa-bubble.fade-out { opacity: 0; transform: translateY(6px); }
.focus-xp-display { position: absolute; bottom: max(30px, env(safe-area-inset-bottom)); font-size: 15px; font-weight: 700; color: var(--gold); opacity: 0.9; }
/* ═══════════ IOS PICKER ═══════════ */
.picker-wrap { height: 140px; position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent); -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent); }
.picker-col { height: 100%; overflow-y: scroll; scrollbar-width: none; width: 100px; text-align: center; scroll-snap-type: y mandatory; padding: 50px 0; }
.picker-col::-webkit-scrollbar { display: none; }
.picker-item { height: 40px; line-height: 40px; font-size: 22px; font-weight: 700; scroll-snap-align: center; color: var(--dark); opacity: 0.15; }
.picker-hl { position: absolute; top: 50%; left: 10%; right: 10%; transform: translateY(-50%); height: 42px; background: rgba(0,0,0,0.04); border-radius: 12px; z-index: -1; pointer-events: none; }
/* ═══════════ PVP — ФОКУС ДУЭЛИ ═══════════ */
.league-card {
    background: linear-gradient(135deg, #FFE27A 0%, #F2AD41 50%, #E89B30 100%);
    padding: 28px 24px; border-radius: 24px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    color: #5B3B00; box-shadow: 0 12px 30px rgba(242,173,65,0.35);
    margin: 0 20px 20px; position: relative; overflow: hidden;
}
.league-card::before {
    content: ''; position: absolute; inset: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.15), transparent, rgba(255,255,255,0.1), transparent);
    animation: leagueShimmer 6s linear infinite;
}
@keyframes leagueShimmer { 100%{transform:rotate(360deg)} }
.league-card * { position: relative; z-index: 1; }
.league-card h3 { font-size: 20px; font-weight: 800; margin: 10px 0 4px; }
.league-card p { font-size: 13px; opacity: 0.7; font-weight: 600; }
.rivals-heading { font-size: 11px; color: var(--gray); letter-spacing: 2px; font-weight: 700; margin: 0 20px 10px; text-transform: uppercase; }

/* ═══════════ AI LOADER ═══════════ */
.dots-loader {
    width: 12px; height: 12px; border: 2px solid var(--purple);
    border-bottom-color: transparent; border-radius: 50%;
    display: inline-block; box-sizing: border-box;
    animation: spin 1s linear infinite;
    margin-right: 4px;
}
.rival-row {
    display: flex; align-items: center; gap: 14px;
    background: var(--white); padding: 16px 18px; border-radius: 20px;
    margin: 0 20px 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}
.rival-row:active { transform: scale(0.98); }
.r-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 17px; flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.r-info { flex:1; display:flex; flex-direction:column; gap:3px; }
.r-info strong { font-size: 15px; font-weight: 700; }
.r-info span { font-size: 12px; color: var(--gray); font-weight: 600; }
.duel-btn {
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    color: #fff; padding: 10px 18px; border-radius: 16px; border: none;
    font-family: var(--font); font-size: 13px; font-weight: 700;
    cursor: pointer; transition: 0.2s;
    box-shadow: 0 4px 12px rgba(123,97,217,0.3);
}
.duel-btn:active { transform: scale(0.93); box-shadow: 0 2px 6px rgba(123,97,217,0.4); }
/* ═══════════ FAIL ═══════════ */
.fail-card { background: #FFF0EE; border-radius: 28px; padding: 36px 28px; max-width: 320px; margin: auto; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 20px 50px rgba(211,47,47,0.2); transform: scale(0.85) translateY(20px); opacity: 0; transition: all 0.4s cubic-bezier(.32,.72,0,1); }
.modal-overlay.open .fail-card { transform: scale(1) translateY(0); opacity: 1; }
.fail-heart { animation: heartbeat 1.8s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(211,47,47,0.4)); }
@keyframes heartbeat { 0%,100%{transform:scale(1)} 15%{transform:scale(1.18) rotate(-2deg)} 30%{transform:scale(0.95) rotate(1deg)} 45%{transform:scale(1.12) rotate(-1deg)} 60%{transform:scale(1)} }
.fail-card h2 { font-size: 22px; font-weight: 800; color: #D32F2F; margin: 12px 0 8px; }
.fail-card p { font-size: 14px; color: #7A3A3A; margin-bottom: 16px; line-height: 1.4; }
.penalty-badge { background: #FF4A5A; color: #fff; font-weight: 800; padding: 6px 18px; border-radius: 20px; font-size: 18px; margin-bottom: 20px; animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }
.btn-primary { flex: 1; padding: 16px; border-radius: 20px; background: var(--dark); color: #fff; border: none; font-family: var(--font); font-size: 15px; font-weight: 700; cursor: pointer; width: 100%; transition: 0.15s; }
.btn-primary:active { transform: scale(0.97); }
/* ═══════════ SETTINGS ═══════════ */
.settings-list { padding: 0 20px; display:flex; flex-direction:column; gap:12px; }
.set-item { display:flex; justify-content:space-between; align-items:center; background:var(--white); padding:20px; border-radius:var(--r); box-shadow:0 2px 10px rgba(0,0,0,0.03); cursor:pointer; font-size:15px; transition:0.2s; }
.set-item:active { transform: scale(0.98); }
.set-item span { color:var(--gray); font-size:14px; font-weight:500; }
.toggle { width:44px; height:24px; background:#ddd; border-radius:12px; position:relative; transition:0.3s; cursor:pointer; }
.dark-theme .toggle { background: #39393D; }
.toggle::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; background:#fff; border-radius:50%; transition:0.3s; box-shadow:0 2px 5px rgba(0,0,0,0.2); }
.toggle.active { background: #5BB974; }
.toggle.active::after { transform:translateX(20px); }
/* Десктоп — тоже заливаем на весь экран, без чёрных полос */
@media (min-width: 500px) {
    .phone-frame { width: 100%; }
    .half-sheet { max-width: 600px; }
    .focus-timer { font-size: 96px; }
}
/* ═══════════ COMPLETION ANIMATIONS ═══════════ */
.w-completed.glow-success {
    animation: neonGlowWidget 0.8s ease-in-out forwards;
}
.w-completed.glow-success .check-ring {
    stroke-dashoffset: 100;
    animation: drawRing 0.5s ease-out forwards;
    stroke: #5BB974 !important;
}
.w-completed.glow-success .check-mark {
    stroke-dashoffset: 24;
    animation: drawRing 0.5s ease-out forwards 0.2s;
    stroke: #5BB974 !important;
}
@keyframes neonGlowWidget {
    0% { background: var(--white); }
    15% { background: #1CE15A; }
    50% { background: #1CE15A; }
    100% { background: var(--white); }
}
