/* Home dashboard, planner widgets, assistant, profile & settings */
.loading { padding: 40px; text-align: center; color: var(--muted); font-weight: 800; }
.mt { margin-top: 18px; }
.link { color: var(--ink); text-decoration: none; font-weight: 700; opacity: .85; }
.link:hover { color: var(--gold); }
.crown { color: var(--gold); }

/* Hero */
.hero { position: relative; display: grid; grid-template-columns: 1fr 230px; min-height: 250px; padding: 0; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 20%; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(5,11,31,.95) 0%, rgba(5,11,31,.6) 35%, rgba(5,11,31,0) 60%); }
.hero-copy { position: relative; z-index: 2; padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; }
.hero-copy h1 { margin: 0 0 8px; transform: rotate(-3deg); transform-origin: left; text-shadow: 0 4px 0 rgba(0,0,0,.5); }
.hero-copy h1 span { display: block; font-size: clamp(30px, 3.4vw, 44px); line-height: .95; }
.hero-copy h1 .big { font-size: clamp(34px, 4.2vw, 54px); background: linear-gradient(180deg, #fff, #9fd0ff); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; }
.hero-copy p { max-width: 300px; font-weight: 700; margin: 0 0 16px; transform: rotate(-2deg); }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.score-card { position: relative; z-index: 2; margin: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(5, 12, 32, .9); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cs-head { display: flex; gap: 12px; align-items: center; }
.cs-cup { font-size: 34px; }
.cs-head small { font-weight: 800; font-size: 15px; }
.cs-score { font: 800 30px var(--font-head); }
.cs-level { color: #6fc3ff; font: 800 20px var(--font-head); }
.cs-nums { text-align: right; }
.cs-stats { display: flex; justify-content: space-between; gap: 6px; text-align: center; }
.cs-stats > div { display: flex; flex-direction: column; align-items: center; font-size: 13px; }
.cs-stats span { font-size: 24px; }
.cs-stats b { font-size: 18px; }

.games-home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.games-home .card img { aspect-ratio: 16/8.5; }

/* Right column */
.side-art { position: relative; height: 220px; border-radius: var(--radius); overflow: hidden; }
.side-art img { width: 100%; height: 100%; object-fit: cover; }
.side-quote { position: absolute; right: 16px; top: 14px; margin: 0; font: 700 24px/1.05 var(--font-hand); transform: rotate(-8deg); text-shadow: 0 2px 8px #000; text-align: right; }
.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.topic-list a { display: flex; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.topic-list a:hover { background: rgba(47,128,255,.12); }
.topic-list span { font-size: 20px; }
.top-score { display: flex; align-items: center; gap: 12px; }
.top-score img { border-radius: 8px; width: 80px; height: 45px; object-fit: cover; }
.top-score b { display: block; font: 800 28px var(--font-head); color: var(--gold); }
.top-score .medal { font-size: 30px; margin-left: auto; }

/* Widgets */
.wlist { list-style: none; margin: 0; padding: 0; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid rgba(82,150,255,.12); font-size: 15px; }
.wrow:last-child { border-bottom: 0; }
.wrow.is-today { background: linear-gradient(90deg, rgba(255,199,44,.14), transparent); border-radius: 8px; }
.wrow.is-today .w-day { color: var(--gold); }
.wrow.is-done .w-grow { color: var(--muted); text-decoration: line-through; }
.w-day { width: 40px; flex: none; }
.w-time { width: 54px; flex: none; font-variant-numeric: tabular-nums; }
.w-grow { flex: 1; min-width: 0; }
.w-ico { width: 24px; text-align: center; flex: none; }
.w-num { width: 70px; }
.w-icon { width: 60px; text-align: center; }
.w-color { width: 44px; padding: 2px; height: 38px; }
.w-unit { width: 120px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.wcheck { appearance: none; width: 20px; height: 20px; border: 2px solid #6b86b8; border-radius: 5px; flex: none; cursor: pointer; margin: 0; display: grid; place-items: center; background: transparent; }
.wcheck:checked { background: #14b8a6; border-color: #14b8a6; }
.wcheck:checked::after { content: '✓'; color: #fff; font-weight: 900; font-size: 14px; }
.empty { padding: 12px 4px; }
.wprogress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.wprogress .progress { flex: 1; height: 8px; }
.wedit { display: flex; flex-direction: column; gap: 8px; }
.wedit-row { display: flex; gap: 6px; align-items: center; }
.wedit-row .w-grow { flex: 1; }
.wedit-row .w-day { width: 78px; }
.wedit-row .w-time { width: 96px; }
.wedit-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.icon-btn.sm { font-size: 16px; padding: 2px 8px; border: 1px solid var(--line); }
.icon-btn.plus { background: rgba(34,197,94,.2); }
.goal { padding: 10px 2px; border-bottom: 1px solid rgba(82,150,255,.12); }
.goal-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.goal-count { font-weight: 800; color: var(--gold-2); font-size: 14px; }
.goal.is-done .progress i { background: linear-gradient(90deg, #facc15, #f59e0b); }

/* Matches */
.match-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; }
.match-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.match-form .span2 { grid-column: span 2; }
.score-in { display: flex; gap: 6px; align-items: center; color: var(--ink); }
.match-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.mstat { background: #0b1d45; border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 8px; }
.mstat b { display: block; font: 800 24px var(--font-head); color: var(--gold); }
.mstat small { color: var(--muted); font-weight: 700; }
.res { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; flex: none; }
.res-W { background: var(--green); } .res-D { background: #64748b; } .res-L { background: var(--red); }
.matches .w-time { width: 96px; }

/* Drills */
.drills { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.drill { background: #0a1838; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.drill.running { border-color: var(--green); box-shadow: 0 0 20px rgba(34,197,94,.35); }
.drill-top { display: flex; align-items: center; gap: 10px; }
.drill-top h3 { margin: 0; flex: 1; font-size: 19px; }
.drill-ico { font-size: 28px; }
.drill-clock { font: 800 20px var(--font-head); color: var(--gold); }
.drill ol { padding-left: 20px; color: var(--muted); font-size: 14px; }
.drill-btns { display: flex; gap: 8px; align-items: center; }
.plan-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* Assistant */
.assistant-head { display: flex; align-items: center; gap: 18px; }
.assistant-ava { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--blue); box-shadow: 0 0 22px var(--glow); object-fit: cover; }
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chat-log { height: min(56vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 88%; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-ava { font-size: 26px; flex: none; }
.msg-body { padding: 10px 14px; border-radius: 16px; background: #0d2252; border: 1px solid var(--line); font-size: 16.5px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-user .msg-body { background: linear-gradient(180deg, #ffd650, #f5b52e); color: #1b1300; border-color: transparent; }
.msg-speak { flex: none; align-self: flex-end; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-chips .chip { cursor: pointer; }
.prompt-chips .chip:hover { background: rgba(255,199,44,.25); }
.chat-form { display: flex; gap: 8px; align-items: stretch; }
.chat-input { flex: 1; resize: vertical; min-height: 48px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.mem summary { cursor: pointer; font-weight: 800; }
.mem-list { padding-left: 18px; }
.mem-list li { margin: 4px 0; }

/* Profile & settings */
.profile-top { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.big-avatar { font-size: 64px; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--gold); box-shadow: 0 0 24px rgba(255,199,44,.35); background: #0b1d45; }
.profile-top .cs-stats { gap: 18px; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.award { text-align: center; padding: 12px 8px; border-radius: 12px; background: #0a1838; border: 1px solid var(--line); opacity: .55; display: flex; flex-direction: column; gap: 2px; }
.award span { font-size: 32px; }
.award.got { opacity: 1; border-color: var(--gold); box-shadow: 0 0 14px rgba(255,199,44,.25); }
.award small { color: var(--muted); }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid rgba(82,150,255,.15); }
.stats-table td:not(:first-child), .stats-table th:not(:first-child) { text-align: right; }
.stats-table a { color: var(--ink); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.sync-code { font: 800 22px var(--font-head); color: var(--gold); letter-spacing: .08em; user-select: all; }

@media (max-width: 1250px) {
  .grid-home > .col:last-child { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
  .games-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero::before { background: linear-gradient(180deg, rgba(5,11,31,.75), rgba(5,11,31,.6)); }
  .match-stats { grid-template-columns: repeat(3, 1fr); }
  .profile-top { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .msg { max-width: 100%; }
}
@media (max-width: 520px) {
  .grid-home > .col:last-child { grid-template-columns: minmax(0, 1fr); }
  .wedit-row { flex-wrap: wrap; }
  .match-form .span2 { grid-column: auto; }
}
