/* ============================================================
   Production-a — Black BG + Red Timer + Warm Yellow + White
   ============================================================ */

:root {
  /* Базовая палитра */
  --bg:            #0A0A0A;
  --bg-elev:       #1A1A1A;

  /* Banner colors */
  --c-red:         #FF0000;       /* YouTube red */
  --c-red-d:       #CC0000;
  --c-yellow:      #FFC940;       /* warm amber */
  --c-yellow-d:    #E6B130;
  --c-white:       #FFFFFF;

  /* Text colors */
  --ink:           #1A1A1A;       /* для светлых блоков */
  --ink-2:         #424242;
  --ink-3:         #6E6E6E;

  --text:          #F5F1E8;       /* для чёрного фона */
  --text-2:        #C8C8C8;
  --text-muted:    #8C8C8C;

  --line:          rgba(255,255,255,0.10);
  --line-strong:   rgba(255,255,255,0.20);
  --line-on-light: rgba(0,0,0,0.08);

  /* Project tile colors (разноцветные на белой секции) */
  --p-millimone:   #B7E8C5;
  --p-ayaru:       #F4A89E;
  --p-missm:       #F8C8DC;
  --p-baursak:     #FFCB9A;
  --p-kr:          #B0CEEC;
  --p-teachers:    #D0C0F0;
  --p-apai:        #B8E5E0;
  --p-schoolig:    #F4B0CC;
  --p-schoolyt:    #FFE082;
  --p-mentors:     #C8DDB8;

  --r-xl: 28px;
  --r-l:  22px;
  --r-m:  16px;
  --r-s:  12px;

  --fs-display: clamp(32px, 9vw, 44px);
  --fs-h1:      clamp(24px, 6.5vw, 32px);
  --fs-h2:      clamp(19px, 5vw, 24px);
  --fs-h3:      clamp(16px, 4.4vw, 20px);
  --fs-body:    clamp(15px, 4vw, 17px);
  --fs-sm:      clamp(13px, 3.5vw, 15px);
  --fs-xs:      clamp(11px, 3vw, 13px);

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "ss01", "cv09", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.45;
  letter-spacing: -0.005em;
}
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }

a, button { touch-action: manipulation; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ===== Layout ===== */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding:
    max(var(--safe-top), 20px)
    max(var(--safe-right), 16px)
    max(var(--safe-bottom), 110px)
    max(var(--safe-left), 16px);
}
@media (min-width: 720px) { .app { max-width: 920px; } }

/* ===== Greeting ===== */
.greeting {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: var(--text);
}
.greeting-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.greeting-text { flex: 1; min-width: 0; }
.greeting-hello { font-size: var(--fs-h1); font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }

/* ===== Compact action row (Таймер + Календарь на одной дорожке) ===== */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.action-tile {
  border-radius: var(--r-l);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
  position: relative; overflow: hidden;
  min-height: 64px;
  cursor: pointer;
  transition: transform 0.12s;
}
.action-title.big {
  font-size: clamp(15px, 4.4vw, 18px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.action-tile:active { transform: scale(0.97); }
.action-tile.red { background: var(--c-red); color: #fff; box-shadow: 0 6px 18px rgba(255,0,0,0.20); }
.action-tile.white { background: #fff; color: var(--ink); border: 1px solid var(--line-on-light); }
.action-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.action-tile.red .action-icon { background: rgba(255,255,255,0.18); }
.action-tile.white .action-icon { background: rgba(0,0,0,0.06); }
.action-text { flex: 1; min-width: 0; }
.action-title { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.02em; line-height: 1.15; }
.action-sub { font-size: var(--fs-xs); opacity: 0.75; margin-top: 2px; }
.action-tile.red .action-sub { color: rgba(255,255,255,0.85); }

/* Модалка снизу с кнопками */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.sheet-overlay.open { display: flex; }
.sheet {
  background: #fff;
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 420px;
  padding: 18px;
  color: var(--ink);
  margin-bottom: max(var(--safe-bottom), 12px);
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-head h3 { font-size: var(--fs-h2); font-weight: 600; }
.sheet-close { background: rgba(0,0,0,0.08); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; color: var(--ink); }
.sheet-options { display: grid; gap: 8px; }
.sheet-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #F3EFE6;
  border-radius: var(--r-l);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line-on-light);
  transition: transform 0.1s;
}
.sheet-option:active { transform: scale(0.98); }
.sheet-option-ic {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-xs); letter-spacing: 0.04em;
  flex-shrink: 0;
}
.sheet-option-text { flex: 1; min-width: 0; }
.sheet-option-text strong { display: block; font-size: var(--fs-body); font-weight: 600; }
.sheet-option-text small { font-size: var(--fs-xs); color: var(--ink-3); }
.sheet-option .ch { color: var(--ink-3); font-size: 18px; }

/* ===== Red Timer Banner (старый — оставляю на случай если понадобится) ===== */
.banner-red {
  background: var(--c-red);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  box-shadow: 0 10px 30px rgba(255,0,0,0.18);
}
.banner-red::after {
  content: '';
  position: absolute; bottom: -40%; right: -10%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 65%);
  pointer-events: none;
}
.banner-red-head {
  display: flex; justify-content: space-between; align-items: center;
  position: relative;
  margin-bottom: 8px;
}
.banner-red-title {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
}
.banner-red-sub {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.85);
  position: relative;
}
.banner-arrow-w {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== White Banner (Календарь menu) ===== */
.banner-white {
  background: var(--c-white);
  border-radius: var(--r-xl);
  padding: 18px;
  margin-bottom: 14px;
  color: var(--ink);
  position: relative;
}
.banner-white-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.banner-white-head h2 { font-size: var(--fs-h2); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.banner-white .banner-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
}
.menu-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.menu-btn {
  background: #F3EFE6;
  border-radius: var(--r-l);
  padding: 14px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--line-on-light);
  transition: transform 0.12s;
}
.menu-btn:active { transform: scale(0.96); }
.menu-btn strong { display: block; font-size: var(--fs-sm); font-weight: 700; margin-bottom: 3px; color: var(--ink); }

/* ===== Yellow Banner (Этот месяц) ===== */
.banner-yellow {
  background: var(--c-yellow);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  color: var(--ink);
}
.banner-yellow::before {
  content: '';
  position: absolute; bottom: -30%; right: -10%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--c-yellow-d), transparent 60%);
  pointer-events: none;
}
.banner-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; position: relative; }
.banner-title h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.banner-yellow .banner-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.10);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}
.banner-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative;
}
.stat-card {
  background: rgba(255,255,255,0.45);
  border-radius: var(--r-l);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 110px;
  text-align: center;
}
.stat-ring {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
.stat-label {
  font-size: clamp(10px, 2.8vw, 12px);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* ===== White Section (Проекты) ===== */
.section {
  background: var(--c-white);
  border-radius: var(--r-xl);
  padding: 20px 18px;
  margin-bottom: 14px;
  color: var(--ink);
}
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-head h3 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.section-head .banner-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}

/* ===== Project tiles — разноцветные, без кружков, место под PNG ===== */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  border-radius: var(--r-l);
  padding: 14px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 112px;
  position: relative;
  transition: transform 0.12s;
  overflow: hidden;
}
.tile:active { transform: scale(0.97); }
.tile-img {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.tile-img img { max-height: 50px; max-width: 90%; object-fit: contain; }
.tile-name { font-size: var(--fs-sm); color: var(--ink); font-weight: 600; line-height: 1.2; }
.tile-value { font-size: var(--fs-h3); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1.05; margin-top: auto; }
.tile-value small { font-size: 0.6em; color: rgba(0,0,0,0.45); font-weight: 400; }
.tile-progress {
  height: 3px;
  background: rgba(0,0,0,0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.tile-progress > i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
}

/* ===== Bottom tabbar (чёрная капсула, активный лайм/жёлтый) ===== */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(max(var(--safe-bottom), 14px));
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 380px;
  background: #1A1A1A;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 6px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.tabbar a {
  flex: 1;
  height: 46px;
  border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.18s;
}
.tabbar a.on { background: var(--c-yellow); color: var(--ink); }
.tabbar a:active { transform: scale(0.94); }

/* ===== Topbar (внутренние страницы) — на чёрном фоне ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,10,0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding: max(var(--safe-top), 12px) 16px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.topbar .back {
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-sm);
  background: none; border: none; cursor: pointer;
  font-weight: 500;
}
.topbar .title { font-weight: 600; font-size: var(--fs-h3); color: var(--text); }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 12px 14px;
  font-size: var(--fs-body);
  color: var(--text);
  outline: none;
  font-family: inherit;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c-yellow); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-s);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--c-yellow); color: var(--ink); border-color: var(--c-yellow); }
.btn-red { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.btn-block { width: 100%; padding: 14px 20px; font-size: var(--fs-body); }

/* ===== Language toggle (внизу страницы) ===== */
.lang-toggle {
  display: inline-flex;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px;
  margin: 14px auto 6px;
}
.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-toggle button.on {
  background: var(--c-yellow);
  color: var(--ink);
}
.lang-wrap {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  body { padding-top: 0; }
}
