:root {
  --bg: #090d14;
  --bg-card: #121824;
  --bg-card-sub: #172030;
  --bg-card-hover: #1c2638;
  --accent: #00ADB5;
  --accent-light: #38bdf8;
  --accent-glow: rgba(0, 173, 181, 0.25);
  --text: #f1f5f9;
  --text-muted: #8b9bb4;
  --text-dim: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 173, 181, 0.4);
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Background Ambient Glow */
.app-glow {
  position: fixed;
  top: -100px;
  right: -50px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(0, 173, 181, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  background: rgba(9, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: calc(12px + var(--safe-top)) 16px 12px 16px;
  z-index: 50;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 12px var(--accent-glow);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-title span {
  color: var(--accent);
}

/* Group Switcher Button Pill */
.group-pill-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .brand-wrapper {
    gap: 6px;
  }
  .brand-icon {
    width: 28px;
    height: 28px;
  }
  .brand-title {
    font-size: 14.5px;
  }
  .group-pill-btn {
    padding: 5px 8px;
    font-size: 12px;
  }
}

.group-pill-btn:active {
  background: var(--accent-glow);
  border-color: var(--accent);
  transform: scale(0.97);
}

.group-pill-arrow {
  color: var(--accent);
  font-size: 11px;
}

/* Subheader / Status Info */
.sub-header {
  max-width: 640px;
  margin: 10px auto 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.week-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.week-badge-btn:active {
  background: rgba(56, 189, 248, 0.25);
  transform: scale(0.96);
}

/* Favorites + Subgroups Row & Filter Bar */
.fav-subgroups-row {
  max-width: 640px;
  width: 100%;
  margin: 8px auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subgroups-bar {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.subgroup-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.subgroup-btn.active {
  background: var(--bg-card-sub);
  border-color: var(--accent);
  color: var(--accent);
}

/* Favorites Bar */
.fav-groups-bar {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fav-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.fav-group-chip.active {
  border-color: var(--accent);
  color: var(--accent);
}

.fav-add-btn {
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.fav-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11.5px;
}

/* Week Meta Bar (Above days strip) */
.week-meta-bar {
  max-width: 640px;
  margin: 6px auto 4px auto;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.week-meta-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-dot {
  opacity: 0.45;
  font-size: 11px;
}

/* Day Selection Tabs (7 Days Strip) */
.days-bar {
  max-width: 640px;
  margin: 8px auto 0 auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  touch-action: pan-y;
}

.day-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
}

.day-tab.is-today:not(.active) {
  border-color: rgba(0, 173, 181, 0.6);
  background: rgba(0, 173, 181, 0.05);
}

.day-tab.is-today:not(.active) .day-name {
  color: var(--accent);
}

/* Selected Day Headline & Week Navigation Row */
.day-headline-nav-row {
  max-width: 640px;
  margin: 12px auto 6px auto;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.day-headline-text {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.week-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.week-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.week-today-btn {
  background: rgba(0, 173, 181, 0.15);
  border: 1px solid rgba(0, 173, 181, 0.4);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.week-today-btn:hover {
  background: var(--accent);
  color: #090d14;
}

.day-pairs-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 2px;
}

.day-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.day-tab.active .day-name,
.day-tab.active .day-date {
  color: #090d14 !important;
  font-weight: 800;
}

.day-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.day-date {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.day-dots-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 8px;
  margin-top: 4px;
}

.day-pair-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.day-tab.active .day-dots-container:not(.empty) {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 5px;
  border-radius: 8px;
}

.day-tab.active .day-pair-dot {
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Main Content Area */
.app-content {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px calc(80px + var(--safe-bottom)) 16px;
  position: relative;
  z-index: 1;
}

/* Pair Card */
.pairs-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
}

.pair-card {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.pair-card.is-now {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--bg-card), rgba(0, 173, 181, 0.08));
  box-shadow: 0 6px 20px -4px var(--accent-glow);
}

.pair-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  margin-bottom: 10px;
}

.pair-header-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pair-header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.now-live-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(0, 173, 181, 0.15);
  border: 1px solid var(--accent);
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.pair-num-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(0, 173, 181, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Notes inside pair card */
.pair-note-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.note-edit-btn:hover {
  color: #fff;
}
  padding: 3px 8px;
  border-radius: 6px;
}

.pair-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.pair-type-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: auto;
}

.pair-header-left .pair-type-pill {
  margin-left: 0;
  white-space: nowrap;
}

.type-lecture {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.type-practice {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.type-lab {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pair-subject {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 10px;
}

.pair-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.pair-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pair-meta-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

.subgroup-tag {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* Empty State */
.empty-day {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 20px;
  margin-top: 20px;
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.empty-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Bottom Nav Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(9, 13, 20, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding: 8px 16px calc(8px + var(--safe-bottom)) 16px;
  z-index: 60;
}

.nav-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px 12px;
  border-radius: 10px;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-btn svg {
  stroke-width: 2.2;
}

/* Search Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 20px 20px calc(24px + var(--safe-bottom)) 20px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  margin: 0 auto 16px auto;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.modal-sheet-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.search-box-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.search-box-wrapper svg {
  position: absolute;
  left: 14px;
  top: 13px;
  color: var(--text-muted);
}

.group-search-input {
  width: 100%;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.group-search-input:focus {
  border-color: var(--accent);
}

.groups-list-container {
  overflow-y: auto;
  max-height: 50vh;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  padding-right: 4px;
}

.group-item-btn {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 6px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.group-item-btn:active {
  background: var(--accent);
  color: #090d14;
}

/* iOS Banner */
.ios-banner {
  background: linear-gradient(145deg, #162235, #0f1826);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.ios-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.ios-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.ios-banner-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.ios-banner-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

/* Shuriken Spinner */
.spinner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.shuriken-spin {
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
  color: var(--accent);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.spinner-text {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* === ADVANCED PWA 2.0 STYLES === */
.target-banner {
  max-width: 640px;
  margin: 8px auto 0 auto;
  background: rgba(0, 173, 181, 0.12);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.target-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-banner-btn {
  background: var(--accent);
  color: #090d14;
  border: none;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.target-tabs-bar {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.modal-drag-handle,
.modal-header-row,
.search-box-wrapper,
#classroomsBuildingFilter,
.onboarding-modal-banner {
  flex-shrink: 0;
}

.target-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.target-tab.active {
  background: var(--accent);
  color: #090d14;
}

/* Timeline Left Rail */
.timeline-pair-row {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
  position: relative;
  margin-bottom: 12px;
  align-items: stretch;
}

.timeline-rail {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  padding-top: 4px;
}

.timeline-time-start {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.timeline-time-end {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.timeline-rail-line {
  position: absolute;
  top: 40px;
  bottom: -16px;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
}

.timeline-pair-row:last-child .timeline-rail-line {
  display: none;
}

.timeline-node-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 6px;
  z-index: 1;
}

.timeline-pair-row.is-now .timeline-node-circle {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 173, 181, 0.15);
  box-shadow: 0 0 10px var(--accent);
}

.schedule-swipe-container {
  touch-action: pan-y;
  position: relative;
  width: 100%;
}

.slide-left {
  animation: pwaSlideLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-right {
  animation: pwaSlideRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaSlideLeft {
  0% { transform: translateX(30px); opacity: 0.4; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes pwaSlideRight {
  0% { transform: translateX(-30px); opacity: 0.4; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Deadline Badges & Chips */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 8px;
  cursor: pointer;
}

.deadline-badge.done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 14px;
  height: 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Interactive Jump Card inside Lesson Details Modal */
.jump-target-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.jump-target-card:hover, .jump-target-card:active {
  border-color: var(--accent);
  background: rgba(0, 173, 181, 0.08);
}

.jump-target-btn {
  background: rgba(0, 173, 181, 0.12);
  border: 1px solid rgba(0, 173, 181, 0.35);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.jump-target-btn:hover,
.jump-target-card:hover .jump-target-btn {
  background: var(--accent);
  color: #090d14;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Common Modal and Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--accent);
  color: #090d14;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(0, 173, 181, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* Hide native scrollbars globally across all horizontal scroll containers */
.fav-groups-bar,
.subgroups-bar,
.target-tabs-bar,
#classroomsBuildingFilter,
.days-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.fav-groups-bar::-webkit-scrollbar,
.subgroups-bar::-webkit-scrollbar,
.target-tabs-bar::-webkit-scrollbar,
#classroomsBuildingFilter::-webkit-scrollbar,
.days-bar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.fav-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.fav-chip-del:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* Empty Day State (Premium Card) */
.empty-day-card {
  margin: 32px auto;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 22px;
  text-align: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  animation: pwaSlideLeft 0.22s ease;
}

.empty-day-icon-glow {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: rgba(0, 173, 181, 0.12);
  border: 1px solid rgba(0, 173, 181, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(0, 173, 181, 0.25);
}

.empty-day-icon {
  font-size: 36px;
}

.empty-day-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.empty-day-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto 18px auto;
}

.empty-day-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-tag {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Teacher Profile Modal Elements */
.teacher-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.teacher-avatar-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.teacher-meta-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.teacher-meta-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.teacher-meta-val {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  line-height: 1.4;
}

.disc-pill {
  display: inline-block;
  background: rgba(0, 173, 181, 0.1);
  border: 1px solid rgba(0, 173, 181, 0.25);
  color: var(--accent-light);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 3px 2px;
}

/* iOS PWA Install Prompt Banner */
.ios-install-prompt {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 440px;
  background: rgba(18, 24, 38, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(0, 173, 181, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 173, 181, 0.25);
  border-radius: 18px;
  padding: 13px 16px;
  z-index: 1000;
  animation: slideUpIosPrompt 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpIosPrompt {
  from { opacity: 0; transform: translate(-50%, 25px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.ios-prompt-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.ios-prompt-icon img {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 173, 181, 0.2);
}

.ios-prompt-text {
  flex: 1;
  min-width: 0;
}

.ios-prompt-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.ios-prompt-desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: #94a3b8;
}

.ios-prompt-desc b {
  color: #00ADB5;
}

.ios-icon-share {
  display: inline-block;
  vertical-align: -2.5px;
  stroke: #00ADB5;
}

.ios-prompt-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ios-prompt-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.ios-prompt-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(18, 24, 38, 0.96);
  border-right: 1px solid rgba(0, 173, 181, 0.45);
  border-bottom: 1px solid rgba(0, 173, 181, 0.45);
}

/* Multi-Subgroup Combined Card (Exact replica of Ninja Mobile App) */
.pair-type-subgroups-count {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  font-weight: 700;
}

.combined-subgroups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.combined-subgroup-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.combined-subgroup-box:hover {
  background: rgba(0, 173, 181, 0.08);
  border-color: rgba(0, 173, 181, 0.35);
  transform: translateY(-1px);
}

.combined-subgroup-box:active {
  transform: scale(0.99);
}

.subgroup-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.subgroup-box-badge {
  font-size: 11px;
  font-weight: 800;
  color: #00ADB5;
  background: rgba(0, 173, 181, 0.16);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.subgroup-box-teacher {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subgroup-box-subject {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.subgroup-box-room {
  font-size: 12px;
  color: #94a3b8;
}

/* --- ONBOARDING MODAL BANNER & PULSE --- */
.onboarding-modal-banner {
  background: linear-gradient(135deg, rgba(0, 173, 181, 0.18) 0%, rgba(56, 189, 248, 0.12) 100%);
  border: 1px solid rgba(0, 173, 181, 0.4);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 173, 181, 0.15);
  animation: fadeIn 0.3s ease;
}

.onboarding-banner-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboarding-banner-desc {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 5px;
  line-height: 1.45;
}

.group-pill-btn.onboarding-pulse {
  background: rgba(0, 173, 181, 0.2);
  border-color: #00ADB5;
  color: #00ADB5;
  box-shadow: 0 0 12px rgba(0, 173, 181, 0.4);
  animation: pillPulse 2s infinite ease-in-out;
}

@keyframes pillPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 173, 181, 0.3);
    border-color: rgba(0, 173, 181, 0.5);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 173, 181, 0.7);
    border-color: #00ADB5;
  }
}

.welcome-onboarding-card {
  border: 1px dashed rgba(0, 173, 181, 0.45);
  background: radial-gradient(circle at top, rgba(0, 173, 181, 0.08) 0%, rgba(15, 23, 42, 0.6) 80%);
}

/* --- REFRESH BUTTON IN HEADER --- */
.refresh-pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #94a3b8;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.refresh-pill-btn:hover {
  background: rgba(0, 173, 181, 0.12);
  border-color: rgba(0, 173, 181, 0.4);
  color: #00ADB5;
}

.refresh-pill-btn:active {
  transform: scale(0.96);
}

.refresh-icon {
  display: inline-block;
  font-size: 12px;
  transition: transform 0.4s ease;
}

.refresh-pill-btn.spinning .refresh-icon {
  animation: pwaSpin 0.8s linear infinite;
}

@keyframes pwaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- EMPTY WEEK JUMP BOX --- */
.empty-week-jump-box {
  background: linear-gradient(135deg, rgba(0, 173, 181, 0.14) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 1px solid rgba(0, 173, 181, 0.4);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 173, 181, 0.12);
  animation: fadeIn 0.3s ease;
}

.jump-box-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.jump-box-text {
  flex: 1;
}

.jump-box-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 2px;
}

.jump-box-sub {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.jump-box-btn {
  background: #00ADB5;
  color: #0d131f;
  border: none;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
  transition: all 0.2s ease;
}

.jump-box-btn:hover {
  background: #2dd4bf;
  transform: translateY(-1px);
}

.jump-box-btn:active {
  transform: scale(0.96);
}

/* --- PWA FLOATING TOAST --- */
.pwa-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 173, 181, 0.4);
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 173, 181, 0.25);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  max-width: 90vw;
}

.pwa-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pwa-toast.error {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* =========================================================
   BATTLE OF GROUPS ("ЦАРЬ ВО ДВОРЦА" 👑) & HALL OF FAME
   ========================================================= */

/* Sleek Custom Scrollbars (eliminates ugly white browser scrollbars & arrows) */
*,
.battle-modal-scroll,
.modal-sheet,
#targetResultsContainer,
#teacherModalBody {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.28) transparent;
}

*::-webkit-scrollbar,
.battle-modal-scroll::-webkit-scrollbar,
.modal-sheet::-webkit-scrollbar,
#targetResultsContainer::-webkit-scrollbar,
#teacherModalBody::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-track,
.battle-modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb,
.battle-modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover,
.battle-modal-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.5);
}

*::-webkit-scrollbar-button,
.battle-modal-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.brand-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-avatar-crown {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.65));
  pointer-events: none;
  z-index: 3;
}

.hall-of-fame-icon-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.35);
  color: #FFD700;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.12);
}

.hall-of-fame-icon-btn:hover,
.hall-of-fame-icon-btn:active {
  background: rgba(255, 215, 0, 0.18);
  border-color: #FFD700;
  transform: translateY(-1px);
}

/* Golden Pill for "Царь во дворца" Winner Group */
.group-pill-btn.king-of-palace {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.24) 0%, rgba(217, 119, 6, 0.22) 100%) !important;
  border: 1.5px solid #FFD700 !important;
  color: #FFFBEB !important;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  font-weight: 800;
}

.group-pill-btn.king-of-palace .group-pill-arrow {
  color: #FFD700;
}

/* Golden Group Item in Group Picker & Favorites */
.group-item-btn.winner-group {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22) 0%, rgba(217, 119, 6, 0.16) 100%) !important;
  border: 1.5px solid #FFD700 !important;
  color: #FFE57F !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.fav-group-chip.winner-group {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22) 0%, rgba(217, 119, 6, 0.16) 100%) !important;
  border-color: #FFD700 !important;
  color: #FFE57F !important;
}

/* Global Winner Motto Banner */
.winner-motto-banner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.16) 0%, rgba(180, 83, 9, 0.18) 100%);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.12);
}

.winner-motto-crown {
  font-size: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.winner-motto-body {
  flex: 1;
  min-width: 0;
}

.winner-motto-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #FFD700;
}

.winner-motto-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.35;
}

/* Interactive Battle Event Card on Home / Top of Schedule */
.battle-event-banner {
  background: linear-gradient(135deg, rgba(30, 24, 12, 0.94) 0%, rgba(20, 28, 44, 0.96) 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.5);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 215, 0, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.battle-event-banner:active {
  transform: scale(0.985);
}

.battle-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.battle-banner-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.battle-banner-crown {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

.battle-banner-title {
  font-size: 14px;
  font-weight: 800;
  color: #FFD700;
  letter-spacing: -0.2px;
}

.battle-banner-timer {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #FDE68A;
  background: rgba(255, 215, 0, 0.14);
  border: 1px solid rgba(255, 215, 0, 0.32);
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.battle-banner-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 215, 0, 0.16);
}

.battle-banner-status {
  font-size: 12.5px;
  font-weight: 700;
  color: #F8FAFC;
}

.battle-banner-cta {
  font-size: 11.5px;
  font-weight: 800;
  color: #FFD700;
  white-space: nowrap;
}

/* Modal Elements */
.battle-modal-header-title {
  color: #FFD700;
}

.battle-modal-crown-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(217, 119, 6, 0.18));
  border: 1px solid rgba(255, 215, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.battle-status-hero {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.14) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 14px;
  padding: 14px;
}

.battle-timer-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.14);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.battle-rank-accent {
  color: #FFD700;
}

.battle-theme-box {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(217, 119, 6, 0.14));
  border: 1.5px solid #FFD700;
  border-radius: 14px;
  padding: 14px;
}

.battle-theme-title {
  font-weight: 800;
  font-size: 14px;
  color: #FFD700;
  margin-bottom: 4px;
}

.battle-hall-link {
  background: none;
  border: none;
  color: #FFD700;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.battle-antifraud-box {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.45;
}

.battle-prize-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.battle-prize-card {
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.battle-prize-icon {
  font-size: 20px;
  line-height: 1.2;
  flex-shrink: 0;
}

.battle-prize-title {
  font-size: 13px;
  font-weight: 800;
  color: #FEF3C7;
}

.battle-prize-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.battle-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.battle-lb-row {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.battle-lb-row.top-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(217, 119, 6, 0.1));
  border-color: rgba(255, 215, 0, 0.55);
}

.battle-lb-row.top-2 {
  border-color: rgba(226, 232, 240, 0.4);
}

.battle-lb-row.top-3 {
  border-color: rgba(217, 119, 6, 0.45);
}

.battle-lb-row.is-my-group {
  box-shadow: 0 0 0 1.5px var(--accent);
}

.battle-lb-gold-text {
  color: #FFD700;
}

.hall-champion-hero {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22) 0%, rgba(180, 83, 9, 0.18) 100%);
  border: 1.5px solid #FFD700;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.hall-champion-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #FFD700;
  margin-top: 6px;
}

.hall-record-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(17, 24, 39, 0.85) 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hall-season-label {
  font-size: 11px;
  font-weight: 800;
  color: #FFD700;
  text-transform: uppercase;
}

.hall-count-badge {
  background: rgba(255, 215, 0, 0.16);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #FFD700;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
}

/* =========================================================
   EXCLUSIVE GOLDEN THEMES FOR WINNER GROUP ("ЦАРЬ ВО ДВОРЦА")
   ========================================================= */

/* 1. Золотая тёмная (Gold Dark) */
body.theme-gold-dark {
  --bg: #0D0B07;
  --bg-card: #18140C;
  --bg-card-sub: #221C11;
  --border: rgba(255, 215, 0, 0.24);
  --accent: #FFD700;
  --accent-light: #FDE047;
  --accent-glow: rgba(255, 215, 0, 0.25);
  --text: #FFFBEB;
  --text-muted: #D6C79C;
  background-color: #0D0B07;
  color: #FFFBEB;
}

body.theme-gold-dark .app-header,
body.theme-gold-dark .bottom-nav {
  background: rgba(18, 15, 9, 0.92);
  border-color: rgba(255, 215, 0, 0.24);
}

/* 2. Золотая светлая (Gold Light — Royal Ivory & Warm Amber, zero dark/black blocks) */
body.theme-gold-light {
  --bg: #FFFCF2;
  --bg-card: #FFFFFF;
  --bg-card-sub: #FEF7E0;
  --border: rgba(217, 119, 6, 0.28);
  --accent: #D97706;
  --accent-light: #B45309;
  --accent-glow: rgba(217, 119, 6, 0.18);
  --text: #1C1917;
  --text-muted: #78716C;
  background-color: #FFFCF2;
  color: #1C1917;
}

body.theme-gold-light .app-glow {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.14) 0%, transparent 70%);
}

body.theme-gold-light .app-header,
body.theme-gold-light .bottom-nav {
  background: rgba(255, 252, 242, 0.95);
  border-color: rgba(217, 119, 6, 0.25);
}

body.theme-gold-light .brand-title,
body.theme-gold-light .pair-title,
body.theme-gold-light .day-headline-text,
body.theme-gold-light .modal-sheet-title,
body.theme-gold-light .empty-day-title {
  color: #1C1917 !important;
}

body.theme-gold-light .battle-modal-header-title {
  color: #92400E !important;
}

body.theme-gold-light .group-pill-btn.king-of-palace {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%) !important;
  border: 1.5px solid #D97706 !important;
  color: #78350F !important;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.2) !important;
}

body.theme-gold-light .group-pill-btn.king-of-palace .group-pill-arrow {
  color: #B45309;
}

body.theme-gold-light .hall-of-fame-icon-btn {
  background: #FEF3C7;
  border-color: rgba(217, 119, 6, 0.45);
  color: #B45309;
}

body.theme-gold-light .group-item-btn.winner-group,
body.theme-gold-light .fav-group-chip.winner-group {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%) !important;
  border-color: #D97706 !important;
  color: #78350F !important;
}

body.theme-gold-light .winner-motto-banner {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.12);
}

body.theme-gold-light .winner-motto-label {
  color: #92400E;
}

body.theme-gold-light .winner-motto-text {
  color: #1C1917;
}

body.theme-gold-light .pair-card {
  background: #FFFFFF;
  border-color: rgba(217, 119, 6, 0.22);
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.07);
}

body.theme-gold-light .combined-subgroup-box {
  background: #FFFBEB;
  border-color: rgba(217, 119, 6, 0.25);
}

body.theme-gold-light .subgroup-box-teacher,
body.theme-gold-light .subgroup-box-subject {
  color: #1C1917;
}

body.theme-gold-light .subgroup-box-room {
  color: #57534E;
}

body.theme-gold-light .modal-sheet {
  background: #FFFCF2;
  color: #1C1917;
  border-color: rgba(217, 119, 6, 0.35);
}

body.theme-gold-light .modal-sheet-close {
  background: rgba(217, 119, 6, 0.12);
  color: #78350F;
}

body.theme-gold-light .battle-event-banner {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: #D97706;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.15);
}

body.theme-gold-light .battle-banner-title,
body.theme-gold-light .battle-banner-cta {
  color: #92400E;
}

body.theme-gold-light .battle-banner-status {
  color: #1C1917;
}

body.theme-gold-light .battle-banner-bottom {
  border-top-color: rgba(217, 119, 6, 0.25);
}

body.theme-gold-light .battle-banner-timer {
  background: rgba(217, 119, 6, 0.16);
  color: #78350F;
  border-color: rgba(217, 119, 6, 0.4);
}

body.theme-gold-light .battle-status-hero {
  background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.08);
}

body.theme-gold-light .battle-timer-pill {
  color: #78350F;
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.4);
}

body.theme-gold-light .battle-rank-accent,
body.theme-gold-light .battle-lb-gold-text,
body.theme-gold-light .battle-hall-link {
  color: #B45309;
}

body.theme-gold-light .battle-theme-box {
  background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
  border-color: #D97706;
}

body.theme-gold-light .battle-theme-title {
  color: #92400E;
}

body.theme-gold-light .battle-lb-row {
  background: #FFFFFF;
  border-color: rgba(217, 119, 6, 0.22);
}

body.theme-gold-light .battle-lb-row.top-1 {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: #D97706;
}

body.theme-gold-light .battle-prize-card {
  background: #FFFBEB;
  border-color: rgba(217, 119, 6, 0.3);
}

body.theme-gold-light .battle-prize-title {
  color: #78350F;
}

body.theme-gold-light .battle-prize-desc {
  color: #57534E;
}

body.theme-gold-light .battle-antifraud-box {
  background: #FEF7E0;
  border-color: rgba(217, 119, 6, 0.28);
  color: #57534E;
}

body.theme-gold-light .hall-champion-hero {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: #D97706;
}

body.theme-gold-light .hall-champion-badge,
body.theme-gold-light .hall-season-label {
  color: #92400E;
}

body.theme-gold-light .hall-record-card {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-color: rgba(217, 119, 6, 0.38);
}

body.theme-gold-light .hall-count-badge {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.4);
  color: #78350F;
}

body.theme-gold-light .day-item,
body.theme-gold-light .subgroup-btn,
body.theme-gold-light .week-nav-btn,
body.theme-gold-light .refresh-pill-btn {
  background: #FFFFFF;
  border-color: rgba(217, 119, 6, 0.25);
  color: #44403C;
}

body.theme-gold-light .day-item.active,
body.theme-gold-light .subgroup-btn.active {
  background: #D97706;
  border-color: #D97706;
  color: #FFFFFF;
}

/* Global Server Broadcast Announcement Banner (PWA) */
.pwa-announcement-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(0, 173, 181, 0.12);
  border: 1px solid rgba(0, 173, 181, 0.35);
}

.pwa-announcement-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 173, 181, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.pwa-announcement-body {
  flex: 1;
  min-width: 0;
}

.pwa-announcement-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.pwa-announcement-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.pwa-announcement-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.pwa-announcement-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

/* --- v1.0.2 PWA ADDITIONS --- */
.profile-icon-btn {
  position: relative;
}

.profile-dot-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid var(--bg);
}

.user-greeting-bar {
  max-width: 640px;
  margin: 8px auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(0, 173, 181, 0.08);
  border: 1px solid rgba(0, 173, 181, 0.22);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}

.user-greeting-edit {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.changelog-bubble {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(0, 173, 181, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.changelog-bubble-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  flex-wrap: wrap;
}

.changelog-bubble-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.changelog-bubble-cta {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.profile-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.profile-field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.profile-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.profile-input:focus {
  border-color: var(--accent);
}

.profile-status-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-status-pills .subgroup-btn {
  flex: 1;
  min-width: 90px;
  text-align: center;
}

.profile-push-status {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.profile-ios-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
}

.profile-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.profile-link-row:hover {
  border-color: var(--accent);
  background: rgba(0, 173, 181, 0.08);
}

.profile-link-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.profile-link-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.profile-link-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.profile-link-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.profile-link-arrow {
  font-size: 14px;
  color: var(--text-muted);
}

.changelog-modal-body {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

/* Parallel 2-Subgroup Grid & Compact Other Subgroup Row (v1.0.2 Item #15) */
.combined-subgroups-list.parallel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.combined-subgroups-list.parallel-grid .combined-subgroup-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 9px 10px;
}

.combined-subgroups-list.parallel-grid .subgroup-box-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.combined-subgroups-list.parallel-grid .subgroup-box-teacher,
.combined-subgroups-list.parallel-grid .subgroup-box-subject {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.3;
}

.other-subgroup-compact-row {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.15s, border-color 0.15s;
}

.other-subgroup-compact-row:hover {
  opacity: 1;
  border-color: rgba(0, 173, 181, 0.4);
}

.other-subgroup-compact-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live Runner Bar inside Active Card */
.live-card-runner-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 0 10px 0;
  overflow: visible;
}

.live-card-runner-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00ADB5, #ef4444);
  position: relative;
  transition: width 0.4s ease;
}

.live-card-runner-dot {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.85);
}

body.theme-gold-light .profile-card,
body.theme-gold-light .changelog-modal-body {
  background: #FFFBEB;
  border-color: rgba(217, 119, 6, 0.25);
}

body.theme-gold-light .profile-input {
  background: #FFFFFF;
  color: #1C1917;
  border-color: rgba(217, 119, 6, 0.35);
}

body.theme-gold-light .profile-link-row {
  background: #FFFFFF;
  border-color: rgba(217, 119, 6, 0.2);
}

body.theme-gold-light .other-subgroup-compact-row {
  background: rgba(217, 119, 6, 0.05);
  border-color: rgba(217, 119, 6, 0.25);
  color: #57534E;
}



