/* GoGrinder Mobile (FSRS PWA) - Self-Contained Mobile-First Stylesheet */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273449;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --emerald: #10b981;
  --gold: #facc15;
  --danger: #ef4444;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: -webkit-fill-available;
  background: var(--bg);
  color: var(--text);
  font-family: 'Malgun Gothic', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  overflow: hidden;
  user-select: none;
}

.hidden { display: none !important; }

/* App Shell — full viewport with iOS Standalone chin-gap compensation (--app-height) */
.app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg);
  padding-top: 0;
}

html.ios-standalone,
html.ios-standalone body {
  height: 100%;
  min-height: 100%;
}

html.ios-standalone .app-shell {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: auto;
}

/* Header */
.top-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: #131d33;
  background-color: #131d33;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-shrink: 0;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.mode-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.streak-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.55);
  cursor: pointer;
  min-height: 32px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: box-shadow 0.16s ease, transform 0.12s ease;
}

.streak-pill.active {
  box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #fde047, 0 0 14px rgba(250, 204, 21, 0.55);
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.view-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  gap: 12px;
}

/* Play View */
.play-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.75);
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  font-size: 12px;
  gap: 8px;
  flex-shrink: 0;
}

.turn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.turn-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.turn-dot.black { background: radial-gradient(circle at 35% 35%, #64748b, #090d16); border: 1px solid #475569; }
.turn-dot.white { background: radial-gradient(circle at 35% 35%, #ffffff, #cbd5e1); border: 1px solid #94a3b8; }

.prob-title {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.prob-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
}

.timer-pill {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Status Banner */
.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  flex-shrink: 0;
  background: #172033;
  border-bottom: 1px solid var(--border);
}
.status-banner.playing { color: #cbd5e1; }
.status-banner.right { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.45); }
.status-banner.wrong { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); }
.status-banner.nav   { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.4); }

.fsrs-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--gold);
  white-space: nowrap;
}

/* Board Stage */
.board-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  overflow: hidden;
}

#gobanCanvas {
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  touch-action: none;
  cursor: pointer;
  margin: auto;
}

/* 2-Tap Aim Confirmation Pill (Zero-Shift Floating Overlay inside .board-stage) */
.aim-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.62);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  max-width: calc(100% - 16px);
}

.aim-label {
  font-size: 13.5px;
  font-weight: 900;
  color: #6ee7b7;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 34px;
  text-align: center;
}

.aim-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-aim-confirm {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #34d399;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.btn-aim-confirm:active {
  transform: scale(0.95);
}

.btn-aim-cancel {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-aim-cancel:active {
  transform: scale(0.95);
}

/* Info Strips */
.info-footer {
  padding: 6px 12px;
  background: #131d33;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.info-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-strip {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid var(--accent);
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.38;
  flex: 1;
  min-width: 0;
}
@media (max-width: 1023px) {
  .comment-strip {
    padding: 4px 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.mobile-today-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}
.mobile-today-pill:active { transform: scale(0.95); }
.mobile-today-pill .mtp-ox { font-weight: 800; color: #94a3b8; }

@media (min-width: 1024px) {
  .mobile-today-pill { display: none; }
}

.history-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.pill-new { background: #1e3a8a; color: #93c5fd; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.pill-mastered { background: #064e3b; color: #6ee7b7; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.pill-wrong { background: #7f1d1d; color: #fca5a5; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.pill-review { background: #334155; color: #e2e8f0; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.ox-o { color: #34d399; margin: 0 1px; }
.ox-x { color: #f87171; margin: 0 1px; }
.stab-tag { margin-left: auto; color: var(--accent); font-weight: 700; }

/* Action Buttons Row (Min 44px touch targets) */
.action-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 7px 8px;
  background: #131d33;
  flex-shrink: 0;
}

.act-btn {
  min-height: 46px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  touch-action: manipulation;
}
.act-btn:active { transform: scale(0.97); }
.act-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.act-btn:disabled:active { transform: none; }
.act-btn.active { background: #1d4ed8; border-color: #60a5fa; color: #ffffff; }
.act-btn.primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #60a5fa; color: #ffffff; }

/* Bottom Tab Navigation (5 tabs: Play, Kifu, Collections, Sanbon Dojo Friends, News) */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #0b1120;
  border-top: 1px solid var(--border);
  padding-bottom: 0;
  flex-shrink: 0;
}

.nav-tab {
  min-height: 48px;
  min-width: 0;
  padding: 3px 1px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: -0.35px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-tab .tab-ico { font-size: 17px; line-height: 1; }
.nav-tab.active { color: var(--accent); background: rgba(56, 189, 248, 0.08); }

/* Collections View */
.notice-card {
  background: rgba(30, 58, 138, 0.35);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #dbeafe;
}
.notice-card code {
  background: rgba(15, 23, 42, 0.7);
  padding: 1px 5px;
  border-radius: 4px;
  color: #fde047;
}

.mode-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.mode-pill {
  min-height: 36px;
  padding: 0 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-pill.active {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--emerald);
  color: #6ee7b7;
}

.col-search-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.col-search-toolbar .search-input {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
}
.col-inline-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.col-inline-count {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.col-inline-collapse-btn {
  min-height: 36px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.search-input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  container-type: inline-size;
}

.folder-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid transparent;
  cursor: pointer;
  gap: 6px;
}
.folder-item.active {
  border-color: #38bdf8;
  border-left: 4px solid #38bdf8;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.24), rgba(14, 165, 233, 0.08) 65%, rgba(30, 41, 59, 0.78));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3), 0 6px 18px rgba(14, 165, 233, 0.2);
}
.folder-item.is-included-child:not(.active) {
  border-left: 3px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.06);
}
.folder-item.is-cur-prob-folder:not(.active) {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.08);
}
.folder-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(56, 189, 248, 0.45);
}
.folder-curprob-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
  white-space: nowrap;
  flex-shrink: 0;
}
.col-current-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(30, 41, 59, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.52);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.16);
}
.col-cur-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.col-cur-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #7dd3fc;
}
.col-cur-mode {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-size: 10.5px;
  font-weight: 800;
}
.col-cur-acts {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.btn-col-cur {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-col-cur.primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #60a5fa;
  color: #ffffff;
}
.col-cur-folder {
  font-size: 13.5px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.35;
  word-break: keep-all;
}
.col-cur-prob {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 5px 8px;
}
.col-cur-prob-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fde68a;
  font-weight: 700;
}
.col-cur-prob-idx {
  flex-shrink: 0;
  font-weight: 800;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}
.col-cur-single-stats {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.3;
}
.col-cur-multi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.col-cur-multi-sum {
  font-size: 11px;
  color: #bae6fd;
  font-weight: 700;
}
.col-cur-multi-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 190px;
  overflow-y: auto;
}
.col-cur-multi-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.col-cur-multi-item.is-here {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(245, 158, 11, 0.12);
}
.col-cur-multi-jump {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.col-cur-multi-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
}
.cm-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  height: 17px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.24);
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}
.cm-path {
  word-break: keep-all;
}
.cm-here-tag {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
}
.col-cur-multi-stats {
  font-size: 10.5px;
  color: #94a3b8;
}
.cm-due {
  color: #fca5a5;
  font-weight: 800;
}
.col-cur-multi-del {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.col-cur-multi-del:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}
.folder-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  width: 100%;
}
.folder-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 200px;
}
.folder-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.16s ease, color 0.16s ease;
  flex-shrink: 0;
  user-select: none;
}
.folder-arrow.expanded {
  transform: rotate(90deg);
  color: var(--accent);
}
.folder-arrow.empty {
  opacity: 0;
  pointer-events: none;
  width: 14px;
}
.folder-icon {
  flex-shrink: 0;
}
.folder-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  flex-shrink: 0;
  max-width: 100%;
}

@container (max-width: 540px) {
  .folder-item {
    padding: 8px 10px;
  }
  .folder-left {
    flex: 1 1 100%;
  }
  .folder-name {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  .folder-badges {
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
  }
}

@media (max-width: 600px) {
  .folder-item {
    padding: 8px 10px;
  }
  .folder-left {
    flex: 1 1 100%;
  }
  .folder-name {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  .folder-badges {
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
  }
}
.btn-folder-play {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-folder-play:hover,
.btn-folder-play:active {
  background: #38bdf8;
  color: #0f172a;
}
.folder-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(15, 23, 42, 0.55);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.due-pill {
  font-size: 10.5px;
  font-weight: 800;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.mastery-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.mastery-badge.st-mastered {
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.5);
}
.mastery-badge.st-ready {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}
.mastery-badge.st-learning {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.mastery-badge.st-new {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.folder-bottom-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 2px;
}
.folder-progress-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.folder-progress-track.is-complete {
  border-color: rgba(52, 211, 153, 0.58);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.24);
}
.folder-progress-solved {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.28);
  transition: width 0.25s ease;
}
.folder-progress-solved.is-complete {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.45), rgba(52, 211, 153, 0.62));
}
.folder-progress-fill {
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.folder-progress-fill.st-mastered { background: linear-gradient(90deg, #f59e0b, #facc15); }
.folder-progress-fill.st-ready    { background: linear-gradient(90deg, #059669, #34d399); }
.folder-progress-fill.st-learning { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.folder-progress-fill.st-new      { background: transparent; }
.folder-progress-track.is-complete .folder-progress-fill.st-learning {
  background: linear-gradient(90deg, #10b981, #38bdf8);
}
.folder-stat-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.folder-done-chip {
  font-size: 10px;
  font-weight: 900;
  padding: 1.5px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  line-height: 1.25;
  white-space: nowrap;
}
.folder-done-chip.is-gold {
  background: rgba(250, 204, 21, 0.22);
  border-color: rgba(250, 204, 21, 0.58);
  color: #fde047;
}
.folder-sub-stat {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.folder-sub-stat.is-done {
  color: #a7f3d0;
  font-weight: 700;
}
.folder-solved-pct {
  color: #cbd5e1;
  font-weight: 800;
}
.folder-item.is-all-solved:not(.active) {
  border-color: rgba(52, 211, 153, 0.36);
}

/* Multi-collection Selection & Floating Bar */
.folder-multi-chk {
  -webkit-appearance: none;
  appearance: none;
  width: 19px;
  height: 19px;
  margin: 0 6px 0 0;
  border-radius: 6px;
  border: 1.5px solid rgba(148, 163, 184, 0.42);
  background: rgba(15, 23, 42, 0.78);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.folder-multi-chk:hover {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(30, 41, 59, 0.92);
}
.folder-multi-chk:checked {
  border-color: #7dd3fc;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3 3 6.6-6.8' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(135deg, #0284c7, #38bdf8);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px, 100% 100%;
}
.folder-item.has-active-desc:not(.active) {
  border-color: rgba(56, 189, 248, 0.5);
  border-left: 4px dashed #38bdf8;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(30, 41, 59, 0.72));
}
.folder-desc-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  background: rgba(14, 165, 233, 0.18);
  border: 1px dashed #38bdf8;
  color: #7dd3fc;
  white-space: nowrap;
  flex-shrink: 0;
}
.folder-multi-chk.is-partial-chk:not(:checked) {
  border-color: #38bdf8;
  background-color: rgba(14, 165, 233, 0.28);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3.5' y='3.5' width='9' height='9' rx='2' fill='%2338bdf8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
}
.folder-multi-chk.is-included-chk:not(:checked) {
  border-color: rgba(56, 189, 248, 0.55);
  background-color: rgba(14, 165, 233, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='%237dd3fc' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.multi-select-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  z-index: 20;
  gap: 12px;
}

.multi-select-bar.hidden {
  display: none !important;
}

.multi-select-info {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

.multi-select-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-multi-clear {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(51, 65, 85, 0.7);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-multi-clear:hover {
  background: rgba(71, 85, 105, 0.85);
  color: #f1f5f9;
}

.btn-multi-start {
  padding: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.5);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transition: all 0.15s ease;
}
.btn-multi-start:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

/* 50 Streak Tower Dashboard */
.card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.tower-hero {
  background: linear-gradient(150deg, #172554, #0f172a);
  border-color: rgba(250, 204, 21, 0.45);
  text-align: center;
}

.tier-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(15, 23, 42, 0.65);
  margin-bottom: 8px;
}

.streak-big {
  font-size: 20px;
  color: #fde047;
  margin-bottom: 6px;
}
.streak-pct { font-size: 13px; color: #cbd5e1; }
.streak-title { font-size: 14px; font-weight: 800; color: #fef08a; margin-bottom: 4px; }
.streak-sub { font-size: 12px; color: #cbd5e1; line-height: 1.45; }

.card-section-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 10px;
}

.tower-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}

.tower-cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.tower-cell.empty { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.35); border: 1px solid rgba(255, 255, 255, 0.08); }
.tower-cell.filled { color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.35); }
.tower-cell.filled.tier-1 { background: #22c55e; }
.tower-cell.filled.tier-2 { background: #3b82f6; }
.tower-cell.filled.tier-3 { background: #f59e0b; }
.tower-cell.filled.tier-4 { background: #a855f7; }
.tower-cell.filled.tier-5 { background: #ec4899; }
.tower-cell.current { box-shadow: 0 0 10px rgba(250, 204, 21, 0.85); transform: scale(1.06); }

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.stat-lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.stat-val { font-size: 19px; font-weight: 800; color: #f8fafc; }
.stat-sub { font-size: 11px; color: #cbd5e1; margin-top: 2px; }

.dist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dist-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
}
.chip-mastered { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.chip-review   { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.chip-learning { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.chip-new      { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.hs-filter-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.hs-filter-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hs-filter-btn.active {
  background: var(--accent);
  color: #0f172a;
}
.hs-current-folder-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.hs-cur-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  word-break: break-all;
}
.hs-cur-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.hs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  gap: 8px;
}
.hs-row:last-child { border-bottom: none; }
.hs-folder { font-size: 13px; font-weight: 700; color: #f8fafc; }
.hs-meta { font-size: 11px; color: var(--muted); }
.hs-score { font-size: 13.5px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.empty-hs { font-size: 12.5px; color: var(--muted); text-align: center; padding: 12px 0; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 900;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #f8fafc;
}

.modal-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0 0 16px;
}

.modal-stack-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-full {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
}
.btn-safe-primary { background: #2563eb; color: #ffffff; }
.btn-danger-ghost { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-secondary { background: var(--surface-2); color: #e2e8f0; border: 1px solid var(--border); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  font-size: 13px;
  gap: 10px;
}

.setting-row select, .setting-row input[type="number"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
}

.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--emerald);
}

.settings-divider {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  margin: 14px 0 6px;
}

.btn-fsrs-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(37, 99, 235, 0.22));
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.45);
  font-size: 13.5px;
  font-weight: 800;
  text-align: left;
}
.btn-fsrs-guide:active {
  transform: scale(0.99);
}
.fsrs-guide-arrow {
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
}

#fsrsGuideModal {
  z-index: 920;
}
.fsrs-guide-modal-card {
  max-width: 460px;
}
.fsrs-guide-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.fsrs-guide-section {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(51, 65, 85, 0.75);
  border-radius: 12px;
  padding: 12px 13px;
}
.fsrs-guide-section h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent);
}
.fsrs-guide-section p,
.fsrs-guide-section li {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
}
.fsrs-guide-section ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fsrs-guide-note {
  display: inline-block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.fsrs-grade-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 8px;
}
.fsrs-grade-item {
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: rgba(30, 41, 59, 0.65);
}
.fsrs-grade-item.grade-again { border-left: 3px solid #ef4444; }
.fsrs-grade-item.grade-hard { border-left: 3px solid #f59e0b; }
.fsrs-grade-item.grade-good { border-left: 3px solid #10b981; }
.fsrs-grade-item.grade-easy { border-left: 3px solid #38bdf8; }
.fsrs-grade-head {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
}
.fsrs-grade-cond {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  margin: 2px 0 3px;
}
.fsrs-grade-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
}

.auth-field-full {
  grid-column: 1 / -1;
}
.birth-select-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 6px;
}
.birth-select-row select {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.notice-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(74px + var(--safe-bottom));
  transform: translateX(-50%) translateY(16px);
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 1px solid var(--accent);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 950;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Fireworks Overlay */
#fireworksCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.celebration-banner {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
  padding: 18px 16px;
  border-radius: 20px;
  background: rgba(13, 19, 36, 0.94);
  border: 3px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  text-align: center;
  pointer-events: none;
  z-index: 1001;
}
.celebration-banner.legend-50 {
  border-width: 4px;
  box-shadow: 0 0 36px rgba(250, 204, 21, 0.65), 0 0 60px rgba(236, 72, 153, 0.45);
}
.celebration-banner.folder-ready {
  border-width: 3px;
  border-color: #34d399;
  box-shadow: 0 0 32px rgba(52, 211, 153, 0.55), 0 0 54px rgba(56, 189, 248, 0.38);
}
.celebration-banner.folder-ready .celebration-main {
  color: #6ee7b7;
}
.celebration-main {
  font-size: 20px;
  font-weight: 900;
  color: #fde047;
  margin-bottom: 8px;
}
.celebration-sub {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.45;
}

/* ==============================================================================
   Kifu Mode & Korea Baduk Association Official Printout (Phase 2 & 3)
   ============================================================================== */
.kifu-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #172033;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.kifu-meta-title {
  font-weight: 800;
  color: var(--gold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kifu-meta-step {
  font-weight: 700;
  color: #93c5fd;
  white-space: nowrap;
}
/* ============================================================================
   Kifu Navigation Arrow Buttons (Crisp High-Contrast SVG + Labels)
   ============================================================================ */
.kifu-nav-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.kifu-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 54px;
  padding: 8px 4px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kifu-nav-btn svg {
  width: 21px;
  height: 21px;
  display: block;
}

/* Primary step prev/next buttons stand out clearly */
.kifu-nav-btn.step {
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.42), rgba(15, 23, 42, 0.95));
  border-color: rgba(56, 189, 248, 0.48);
  color: #e0f2fe;
}

.kifu-nav-btn:hover:not(:disabled) {
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.32);
  transform: translateY(-1px);
}

.kifu-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.kifu-nav-btn:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  box-shadow: none;
}

.kifu-ctrl-bar {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  background: #101726;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-kifu-ctrl {
  flex: 1;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1e293b;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}
.btn-kifu-ctrl:active {
  background: #334155;
  transform: scale(0.97);
}

/* 기보 저장 목록 모달 */
.kifu-list-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.kifu-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.kifu-card:active {
  background: #283548;
}
.kifu-card.active-kifu {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
}
.kifu-card-info {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}
.kifu-card-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kifu-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.kifu-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-kifu-card-act {
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: #cbd5e1;
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-kifu-card-act:active {
  background: #334155;
}
.btn-kifu-card-del {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* 한국기원 공식 기보 인쇄 양식 */
.print-modal-content {
  background: #ffffff;
  color: #111111;
  width: min(96vw, 680px);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.print-sheet {
  background: #ffffff;
  color: #111111;
  font-family: 'Malgun Gothic', sans-serif;
  padding: 8px;
}
.print-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  border-bottom: 2px solid #111111;
  padding-bottom: 3px;
  margin-bottom: 8px;
}
.print-title {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  margin: 8px 0 10px 0;
  letter-spacing: -0.5px;
}
.print-meta-grid {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 10px;
  border-left: 3px solid #111111;
  padding-left: 8px;
}
.print-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
#kifuPrintCanvas {
  border: 2px solid #111111;
  display: block;
  max-width: 100%;
  height: auto;
}

/* 하단 따낸 자리 재착점 공식 양식 */
.print-dup-section {
  border-top: 1.5px solid #111111;
  padding-top: 10px;
  margin-bottom: 12px;
}
.print-dup-title {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #222222;
}
.print-dup-rows-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.print-dup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}
.print-dup-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  box-sizing: border-box;
  flex-shrink: 0;
  line-height: 1;
}
.stone-badge.b {
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}
.stone-badge.w {
  background: #ffffff;
  color: #111111;
  border: 1.5px solid #111111;
}
.print-dup-hyphen {
  font-weight: 900;
  color: #111111;
  margin: 0 1px;
}
.print-footer {
  border-top: 1px solid #111111;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: #555555;
}
.print-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

@media print {
  body * {
    visibility: hidden;
  }
  #kifuPrintSheet, #kifuPrintSheet * {
    visibility: visible;
  }
  #kifuPrintModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: transparent;
    padding: 0;
  }
  .print-modal-content {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: visible;
  }
  .no-print {
    display: none !important;
  }
}

/* ============================================================================
   Correct / Wrong Visual Feedback Effects (Neon Aurora & Glassmorphism)
   ============================================================================ */
#gobanCanvas.fx-right {
  animation: boardAuroraGlow 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
#gobanCanvas.fx-wrong {
  animation: boardWrongShake 0.46s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes boardAuroraGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.95), 0 0 0 0 rgba(56, 189, 248, 0.85);
    transform: scale(1);
  }
  35% {
    box-shadow: 0 0 26px 6px rgba(52, 211, 153, 0.78), 0 0 54px 12px rgba(250, 204, 21, 0.45), 0 0 70px 16px rgba(56, 189, 248, 0.35);
    transform: scale(1.012);
  }
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    transform: scale(1);
  }
}

@keyframes boardWrongShake {
  0%, 100% { transform: translateX(0); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
  15% { transform: translateX(-8px); box-shadow: 0 0 26px 5px rgba(244, 63, 94, 0.8); }
  32% { transform: translateX(7px);  box-shadow: 0 0 22px 4px rgba(239, 68, 68, 0.65); }
  48% { transform: translateX(-5px); box-shadow: 0 0 18px 3px rgba(244, 63, 94, 0.5); }
  66% { transform: translateX(4px);  box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.3); }
  82% { transform: translateX(-2px); }
}

.board-fx-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 25;
}

.board-fx-card {
  min-width: 176px;
  max-width: 82%;
  padding: 14px 22px;
  border-radius: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  animation: fxCardPop 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.board-fx-overlay.is-right .board-fx-card {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.88), rgba(14, 116, 144, 0.88) 55%, rgba(67, 56, 202, 0.84));
  border: 2px solid rgba(110, 231, 183, 0.9);
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.55), 0 12px 32px rgba(0, 0, 0, 0.5);
}

.board-fx-overlay.is-wrong .board-fx-card {
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.9), rgba(153, 27, 27, 0.88));
  border: 2px solid rgba(251, 113, 133, 0.92);
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.52), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.board-fx-icon {
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.board-fx-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #ffffff, #fef08a, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.board-fx-overlay.is-wrong .board-fx-title {
  background: linear-gradient(90deg, #ffffff, #fda4af, #fdba74);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.board-fx-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(241, 245, 249, 0.95);
}

@keyframes fxCardPop {
  0%   { opacity: 0; transform: scale(0.55) translateY(14px); }
  22%  { opacity: 1; transform: scale(1.06) translateY(-2px); }
  36%  { opacity: 1; transform: scale(1.0) translateY(0); }
  78%  { opacity: 1; transform: scale(1.0) translateY(0); }
  100% { opacity: 0; transform: scale(0.92) translateY(-10px); }
}

.act-btn.primary.pulse-next {
  background: linear-gradient(135deg, #10b981, #0ea5e9) !important;
  border-color: #6ee7b7 !important;
  animation: nextBtnPulse 1.15s ease-in-out infinite;
}

@keyframes nextBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50%      { box-shadow: 0 0 18px 4px rgba(56, 189, 248, 0.75); }
}

/* Hidden Folder Management UI */
.notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-manage-hidden {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-manage-hidden.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fde047;
}
.folder-item.is-hidden-folder {
  opacity: 0.5;
  border: 1px dashed rgba(148, 163, 184, 0.4);
}
.btn-folder-vis {
  min-height: 28px;
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-folder-vis.hide {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.btn-folder-vis.restore {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

/* ============================================================================
   Header Streak Badge - 5-Tier Game Evolution Effects (Up to 50 Streak)
   ============================================================================ */
#headerStreakBadge {
  position: relative;
  overflow: hidden;
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, transform 0.2s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  font-weight: 900;
  letter-spacing: -0.2px;
  isolation: isolate;
}

/* Shimmer sweep overlay for Tier 2+ */
#headerStreakBadge::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -80%;
  width: 55%;
  height: 180%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-22deg);
  opacity: 0;
  pointer-events: none;
}

/* Combo pop when streak increments */
#headerStreakBadge.streak-bump {
  animation: streakComboBump 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes streakComboBump {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* 0 Streak (Idle) */
#headerStreakBadge.tier-0 {
  background: linear-gradient(135deg, #334155, #1e293b);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

/* 1 ~ 9 Streak (Ignition Spark) */
#headerStreakBadge.tier-warm {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  border-color: rgba(253, 224, 71, 0.7);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

/* Stage 1: 10 ~ 19 Streak (Electric Cyan Neon) */
#headerStreakBadge.tier-1 {
  background: linear-gradient(135deg, #0284c7, #06b6d4, #38bdf8);
  color: #ffffff;
  border-color: #7dd3fc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.75), inset 0 0 8px rgba(255, 255, 255, 0.25);
  animation: tier1Glow 2s ease-in-out infinite;
}
@keyframes tier1Glow {
  0%, 100% { box-shadow: 0 0 10px rgba(56, 189, 248, 0.65); }
  50%      { box-shadow: 0 0 18px 2px rgba(34, 211, 238, 0.95); }
}

/* Stage 2: 20 ~ 29 Streak (Emerald Aurora + Metallic Shimmer) */
#headerStreakBadge.tier-2 {
  background: linear-gradient(135deg, #059669, #10b981, #34d399);
  color: #022c22;
  border-color: #a7f3d0;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.8), 0 0 26px rgba(52, 211, 153, 0.4);
}
#headerStreakBadge.tier-2::after {
  opacity: 0.75;
  animation: badgeShimmer 2.4s ease-in-out infinite;
}

/* Stage 3: 30 ~ 39 Streak (Blazing Fire Flame + Pulse) */
#headerStreakBadge.tier-3 {
  background: linear-gradient(135deg, #dc2626, #f97316, #facc15);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  border-color: #fef08a;
  animation: tier3Flame 1.4s ease-in-out infinite;
}
#headerStreakBadge.tier-3::after {
  opacity: 0.85;
  animation: badgeShimmer 1.9s ease-in-out infinite;
}
@keyframes tier3Flame {
  0%, 100% { box-shadow: 0 0 12px rgba(249, 115, 22, 0.85), 0 0 24px rgba(239, 68, 68, 0.5); }
  50%      { box-shadow: 0 0 20px 3px rgba(250, 204, 21, 0.95), 0 0 34px rgba(239, 68, 68, 0.75); }
}

/* Stage 4: 40 ~ 49 Streak (Mystic Plasma Purple-Magenta) */
#headerStreakBadge.tier-4 {
  background: linear-gradient(135deg, #6d28d9, #a855f7, #ec4899);
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  border-color: #f5d0fe;
  animation: tier4Plasma 1.2s ease-in-out infinite;
}
#headerStreakBadge.tier-4::after {
  opacity: 0.95;
  animation: badgeShimmer 1.4s ease-in-out infinite;
}
@keyframes tier4Plasma {
  0%, 100% { box-shadow: 0 0 14px rgba(168, 85, 247, 0.9), 0 0 28px rgba(236, 72, 153, 0.65); }
  50%      { box-shadow: 0 0 24px 4px rgba(236, 72, 153, 1), 0 0 40px rgba(139, 92, 246, 0.85); }
}

/* Stage 5 MAX: 50+ Streak (Holographic Rainbow Legend Crown) */
#headerStreakBadge.tier-5 {
  background: linear-gradient(115deg, #facc15, #fb7185, #c084fc, #38bdf8, #34d399, #facc15);
  background-size: 300% 300%;
  color: #0f172a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  border: 2px solid #ffffff;
  animation: tier5Rainbow 2.2s linear infinite, tier5Aura 1.1s ease-in-out infinite;
}
#headerStreakBadge.tier-5::after {
  opacity: 1;
  animation: badgeShimmer 1.2s ease-in-out infinite;
}
@keyframes tier5Rainbow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes tier5Aura {
  0%, 100% { box-shadow: 0 0 16px rgba(250, 204, 21, 0.95), 0 0 32px rgba(236, 72, 153, 0.75); }
  50%      { box-shadow: 0 0 26px 5px rgba(255, 255, 255, 0.95), 0 0 44px rgba(56, 189, 248, 0.9); }
}

@keyframes badgeShimmer {
  0%   { left: -85%; }
  55%  { left: 145%; }
  100% { left: 145%; }
}

/* ============================================================================
   Bookmark ("사범님께 질문할 문제") Button & Special Collection Card
   ============================================================================ */
.btn-bookmark {
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(251, 191, 36, 0.85);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(234, 179, 8, 0.12));
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.22);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn-bookmark:hover {
  border-color: #fde047;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.36), rgba(234, 179, 8, 0.2));
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}
.btn-bookmark:active {
  transform: scale(0.94);
}
.btn-bookmark.pulse-hint:not(.active) {
  animation: bookmarkPulse 1.35s ease-in-out infinite;
  border-color: #fde047;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(234, 179, 8, 0.22));
}
@keyframes bookmarkPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.65), 0 0 12px rgba(251, 191, 36, 0.32);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0), 0 0 18px rgba(251, 191, 36, 0.5);
    transform: scale(1.05);
  }
}
.btn-bookmark.active {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  border-color: #fef08a;
  color: #0f172a;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.72);
}

.folder-item.bookmark-special {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(234, 179, 8, 0.10));
  border: 1.5px solid rgba(250, 204, 21, 0.65);
  margin-bottom: 10px;
}
.folder-item.bookmark-special.selected {
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.45);
  border-color: #fde047;
}
.bookmark-sub {
  font-size: 11px;
  color: #fde68a;
  margin-top: 2px;
  font-weight: 600;
}

/* Hide desktop-only cards on mobile / tablet (< 1024px) */
.desktop-streak-banner,
.desktop-shortcut-card,
.play-tower-dock {
  display: none;
}

/* ============================================================================
   Desktop Studio Layout (>= 1024px)
   - 1024px ~ 1399px: Left Rail + Full-Height Goban + Snug Control Deck (2-Col)
   - >= 1400px      : + Rightmost Live 50 Streak Tower & Today Stats (3-Col)
   ============================================================================ */
@media (min-width: 1024px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    max-width: 100% !important;
    width: 100vw;
    height: 100vh;
    margin: 0;
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-rows: 54px minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "nav    main";
  }

  .top-header,
  .app-header {
    grid-area: header;
    height: 54px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
  }

  /* FIX 1: Override mobile grid so left nav stacks cleanly vertically */
  .bottom-nav {
    grid-area: nav;
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    width: 88px !important;
    height: 100% !important;
    gap: 10px;
    padding: 16px 10px !important;
    border-top: none !important;
    border-right: 1px solid var(--border);
    background: rgba(11, 18, 32, 0.96);
    z-index: 10;
  }

  .bottom-nav button,
  .bottom-nav .nav-tab,
  .bottom-nav .nav-btn {
    width: 100% !important;
    min-height: 68px;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px;
    padding: 8px 4px;
    border-radius: 14px;
    font-size: 11px;
    line-height: 1.22;
    text-align: center;
    font-weight: 700;
    white-space: normal;
    word-break: keep-all;
  }

  .bottom-nav button.active,
  .bottom-nav .nav-tab.active,
  .bottom-nav .nav-btn.active {
    background: rgba(56, 189, 248, 0.16);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.42);
  }

  .main-content,
  .app-main {
    grid-area: main;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0 !important;
  }

  /* ------------------------------------------------------------------------
     1. Play View (#viewPlay) - Snug 2-Column Studio (1024px ~ 1399px)
     ------------------------------------------------------------------------ */
  #viewPlay.active {
    display: grid !important;
    grid-template-columns: minmax(440px, calc(100vh - 86px)) 340px;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    justify-content: center;
    align-content: stretch;
    column-gap: 20px;
    row-gap: 12px;
    width: 100%;
    height: 100%;
    padding: 16px 24px;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Left: Full-height square Goban frame */
  #viewPlay.active .board-stage {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    border-radius: 18px;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.35));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Middle/Right Control Deck (Clean top-down card flow, no hollow gap) */
  #viewPlay.active > :not(.board-stage):not(.play-tower-dock) {
    grid-column: 2;
  }

  #viewPlay.active .play-meta-bar,
  #viewPlay.active .prob-topbar,
  #viewPlay.active .problem-header {
    grid-row: 1;
    border-radius: 14px;
    background: rgba(23, 32, 51, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 12px 14px;
    font-size: 13px;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
  }

  #viewPlay.active #probTitleText,
  #viewPlay.active .prob-title {
    order: 3;
    flex: 1 0 100%;
    white-space: normal !important;
    word-break: break-all;
    overflow: visible !important;
    text-overflow: unset !important;
    text-align: left;
    line-height: 1.45;
    color: #e2e8f0;
    font-size: 13.5px;
    font-weight: 600;
    padding-top: 6px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
  }

  #viewPlay.active #statusBanner {
    grid-row: 2;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 13px 14px;
    font-size: 14px;
    line-height: 1.4;
  }

  /* Move Action Bar UP right under Status Banner for shortest mouse travel */
  #viewPlay.active .action-bar {
    grid-row: 3;
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 0;
    border-top: none;
    background: transparent;
  }

  #viewPlay.active .action-bar .act-btn {
    min-height: 52px;
    padding: 0 8px;
    border-radius: 13px;
    font-size: 13.5px;
    font-weight: 800;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  #viewPlay.active #btnUndo     { order: 1; grid-column: span 2; }
  #viewPlay.active #btnRestart  { order: 2; grid-column: span 2; }
  #viewPlay.active #btnSolution { order: 3; grid-column: span 2; }
  #viewPlay.active #btnPrev     { order: 4; grid-column: span 3; }
  #viewPlay.active #btnNext     { order: 5; grid-column: span 3; }

  /* Compact Info/History Card (no giant hollow rectangle!) */
  #viewPlay.active .info-footer {
    grid-row: 4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    max-height: 210px;
    overflow-y: auto;
    align-self: start;
  }

  /* Large Desktop Streak Banner (Right above PC Shortcut Card) */
  #viewPlay.active .desktop-streak-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    grid-column: 2;
    grid-row: 5;
    align-self: end;
    width: 100%;
    padding: 18px 20px;
    border-radius: 26px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-sizing: border-box;
    text-align: center;
    transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, transform 0.2s ease;
  }

  #viewPlay.active .desktop-streak-banner::after {
    content: '';
    position: absolute;
    top: -40%;
    left: -80%;
    width: 55%;
    height: 180%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-22deg);
    opacity: 0;
    pointer-events: none;
  }

  .desktop-streak-main {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.6px;
    white-space: nowrap;
  }

  .desktop-streak-sub {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
  }

  #desktopStreakBanner.streak-bump {
    animation: streakComboBump 0.44s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* Tier 0: Idle */
  #desktopStreakBanner.tier-0 {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.82), rgba(30, 41, 59, 0.92));
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.32);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  }

  /* 1 ~ 9 Streak: Warm Ignition */
  #desktopStreakBanner.tier-warm {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #ffffff;
    border-color: rgba(253, 224, 71, 0.78);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.5);
  }

  /* Stage 1 (10 ~ 19): Electric Cyan Neon */
  #desktopStreakBanner.tier-1 {
    background: linear-gradient(135deg, #0284c7, #06b6d4, #38bdf8);
    color: #ffffff;
    border-color: #7dd3fc;
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.75), inset 0 0 14px rgba(255, 255, 255, 0.25);
    animation: tier1Glow 2s ease-in-out infinite;
  }

  /* Stage 2 (20 ~ 29): Emerald Aurora + Shimmer */
  #desktopStreakBanner.tier-2 {
    background: linear-gradient(135deg, #059669, #10b981, #34d399);
    color: #022c22;
    border-color: #a7f3d0;
    box-shadow: 0 0 26px rgba(16, 185, 129, 0.8), 0 0 42px rgba(52, 211, 153, 0.35);
  }
  #desktopStreakBanner.tier-2::after {
    opacity: 0.75;
    animation: badgeShimmer 2.4s ease-in-out infinite;
  }

  /* Stage 3 (30 ~ 39): Blazing Fire Flame */
  #desktopStreakBanner.tier-3 {
    background: linear-gradient(135deg, #dc2626, #f97316, #facc15);
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    border-color: #fef08a;
    animation: tier3Flame 1.4s ease-in-out infinite;
  }
  #desktopStreakBanner.tier-3::after {
    opacity: 0.85;
    animation: badgeShimmer 1.9s ease-in-out infinite;
  }

  /* Stage 4 (40 ~ 49): Mystic Plasma Purple-Magenta */
  #desktopStreakBanner.tier-4 {
    background: linear-gradient(135deg, #6d28d9, #a855f7, #ec4899);
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border-color: #f5d0fe;
    animation: tier4Plasma 1.2s ease-in-out infinite;
  }
  #desktopStreakBanner.tier-4::after {
    opacity: 0.95;
    animation: badgeShimmer 1.4s ease-in-out infinite;
  }

  /* Stage 5 MAX (50+): Holographic Rainbow Legend Crown */
  #desktopStreakBanner.tier-5 {
    background: linear-gradient(115deg, #facc15, #fb7185, #c084fc, #38bdf8, #34d399, #facc15);
    background-size: 300% 300%;
    color: #0f172a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
    border: 2.5px solid #ffffff;
    animation: tier5Rainbow 2.2s linear infinite, tier5Aura 1.1s ease-in-out infinite;
  }
  #desktopStreakBanner.tier-5::after {
    opacity: 1;
    animation: badgeShimmer 1.2s ease-in-out infinite;
  }

  /* Bottom Keyboard Shortcut Card */
  #viewPlay.active .desktop-shortcut-card {
    display: block;
    grid-row: 6;
    align-self: end;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    color: #94a3b8;
    font-size: 11.5px;
  }

  .shortcut-title {
    font-size: 12px;
    font-weight: 800;
    color: #cbd5e1;
    margin-bottom: 8px;
  }

  .shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
  }

  .shortcut-grid kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(51, 65, 85, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #f8fafc;
    font-family: ui-monospace, monospace;
    font-size: 10.5px;
    font-weight: 700;
  }

  /* ------------------------------------------------------------------------
     2. Kifu View (#viewKifu) - Clean 2-Column Studio (Zero Overlap!)
     ------------------------------------------------------------------------ */
  #viewKifu.active {
    display: grid !important;
    grid-template-columns: minmax(440px, calc(100vh - 86px)) 380px;
    grid-template-rows: none;
    grid-auto-rows: max-content;
    justify-content: center;
    align-content: start;
    column-gap: 22px;
    row-gap: 10px;
    width: 100%;
    height: 100%;
    padding: 14px 24px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #viewKifu.active .board-stage,
  #viewKifu.active .kifu-board-stage {
    grid-column: 1;
    grid-row: 1 / span 10;
    width: 100%;
    height: calc(100vh - 86px);
    min-width: 0;
    min-height: 0;
    padding: 12px;
    border-radius: 18px;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.35));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
  }

  #viewKifu.active > :not(.board-stage):not(.kifu-board-stage) {
    grid-column: 2;
    align-self: start;
    height: auto !important;
    min-width: 0;
  }

  #viewKifu.active .kifu-meta-bar {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 11px 14px !important;
    align-items: flex-start;
    gap: 10px;
  }

  #viewKifu.active .kifu-meta-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    flex: 1;
  }

  #viewKifu.active .kifu-meta-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: keep-all;
    font-size: 14px;
    line-height: 1.35;
    width: 100%;
  }

  #viewKifu.active .kifu-meta-subline {
    font-size: 12px;
    gap: 7px;
  }

  #viewKifu.active .kifu-coach-banner {
    border-radius: 12px;
    border: 1px solid rgba(167, 139, 250, 0.48);
    padding: 8px 11px;
  }

  #viewKifu.active .kifu-mode-strip {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 6px;
    gap: 6px;
  }

  #viewKifu.active .kifu-mode-chip {
    height: 32px;
    font-size: 12px;
  }

  #viewKifu.active .kifu-active-banner {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    padding: 8px 10px;
  }

  /* ------------------------------------------------------------------------
     3. Collections, Stats & Baduk News Views - Centered Wide Dashboard
     ------------------------------------------------------------------------ */
  #viewCollections.active,
  #viewTower.active,
  #viewDojo.active,
  #viewNews.active {
    max-width: 1120px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 20px 28px;
    overflow-y: auto;
    box-sizing: border-box;
  }
}

/* ============================================================================
   Wide / Ultrawide Desktop (>= 1400px)
   - Reveals Column 3: Live Motivation Banner + 50 Streak Tower + 4 Today Stats
   - Automatically hides again when window width shrinks below 1400px
   ============================================================================ */
@media (min-width: 1400px) {
  #viewPlay.active {
    grid-template-columns: minmax(440px, calc(100vh - 86px)) 330px minmax(370px, 440px);
    column-gap: 20px;
  }

  #viewPlay.active .play-tower-dock {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    grid-column: 3;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-sizing: border-box;
  }

  /* Ensure every card inside the dock stays strictly within container width */
  .play-tower-dock > * {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
    overflow: hidden;
  }

  .play-tower-dock .motivation-card,
  .play-tower-dock .hero-card,
  .play-tower-dock .tower-hero {
    padding: 12px 14px !important;
    word-break: keep-all;
  }

  /* FIX: Prevent 10-column 50 Streak Tower from overflowing its card border */
  .play-tower-dock .card-box,
  .play-tower-dock .tower-card,
  .play-tower-dock .tower-section {
    padding: 12px !important;
    overflow: hidden !important;
  }

  .play-tower-dock .tower-grid {
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 4px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .play-tower-dock .tower-cell {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
  }

  /* Today's 4 KPI stat cards */
  .play-tower-dock .stats-grid,
  .play-tower-dock .stats-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .play-tower-dock .stats-grid > *,
  .play-tower-dock .stats-grid-4 > * {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Extra-wide monitors (>= 1800px, e.g. QHD / 21:9 Ultrawide) */
@media (min-width: 1800px) {
  #viewPlay.active {
    grid-template-columns: minmax(520px, calc(100vh - 86px)) 350px 480px;
    column-gap: 26px;
    padding: 18px 32px;
  }

  .play-tower-dock .tower-grid {
    gap: 5px !important;
  }

  .play-tower-dock .tower-cell {
    font-size: 12px !important;
    border-radius: 7px !important;
  }
}

/* ============================================================================
   Kifu Recording Utility Bar (A, C) & All-in-One Setup / Overwrite Modals (1, B, D)
   ============================================================================ */
.kifu-tool-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kifu-tool-btn {
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}
.kifu-tool-btn:hover:not(:disabled) {
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 0.95);
}
.kifu-tool-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.kifu-tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.kifu-tool-btn.accent {
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

/* Clickable Kifu Title Bar hint for mid-game editing */
.kifu-title-editable {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.kifu-title-editable:hover {
  border-color: rgba(250, 204, 21, 0.55) !important;
  background: rgba(30, 41, 59, 0.92) !important;
}

/* Setup & Overwrite Modals */
.kifu-setup-card {
  width: min(460px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: 18px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65);
  color: #f1f5f9;
}

.kifu-overwrite-card {
  width: min(400px, 92vw);
  padding: 18px 20px;
  border-radius: 16px;
  background: #0f172a;
  border: 1.5px solid rgba(244, 63, 94, 0.55);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  color: #f1f5f9;
}

.kifu-overwrite-msg {
  margin: 12px 0 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #cbd5e1;
  word-break: keep-all;
  white-space: pre-line;
}

.kifu-setup-warn {
  margin: 8px 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  font-size: 12px;
  font-weight: 700;
}

.kifu-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.kifu-form-group label {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
}

.kifu-form-group input {
  width: 100%;
  min-height: 38px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  font-size: 13.5px;
  box-sizing: border-box;
}
.kifu-form-group input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.kifu-form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kifu-preset-row,
.kifu-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kifu-preset-row {
  margin-bottom: 12px;
}

.kifu-chip-btn {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.kifu-chip-btn:hover {
  border-color: #38bdf8;
  color: #ffffff;
}
.kifu-chip-btn.active {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border-color: #7dd3fc;
  color: #ffffff;
}
.kifu-chip-group.compact .kifu-chip-btn {
  min-height: 27px;
  padding: 2px 8px;
  font-size: 11px;
}

.modal-footer-btns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-modal-secondary {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-modal-primary {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid #7dd3fc;
  background: linear-gradient(135deg, #0284c7, #10b981);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
}

.btn-modal-danger {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid #fda4af;
  background: linear-gradient(135deg, #e11d48, #dc2626);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
}

/* ============================================================================
   Refined Minimalist Kifu Control Deck (Mobile 2-Row Compact + Desktop Studio)
   ============================================================================ */

/* 1. Kifu Header Bar (Ultra-slim on Mobile so 19x19 board maximizes height) */
#viewKifu .kifu-topbar,
#viewKifu .kifu-title-editable {
  padding: 6px 12px !important;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.92));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

/* 2. Mobile Compact 2-Row Unified Control Dock (Only ~104px total height!) */
.kifu-controls-deck {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 8px;
  background: #0d1526;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
}

.kifu-dock-row-1 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.kifu-dock-row-2 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

/* Shared compact 44px touch-friendly button base on mobile */
.kifu-controls-deck .kifu-nav-btn,
.kifu-controls-deck .kifu-tool-btn,
.kifu-controls-deck .kifu-act-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 44px;
  min-height: 44px;
  min-width: 0;
  padding: 3px 2px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.35px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.kifu-controls-deck .kifu-nav-btn span,
.kifu-controls-deck .kifu-tool-btn span,
.kifu-controls-deck .kifu-act-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kifu-controls-deck .kifu-nav-btn svg,
.kifu-controls-deck .kifu-tool-btn svg,
.kifu-controls-deck .kifu-act-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

/* Row 2 has slightly wider buttons (5 cols) -> crisp 10.5px label */
.kifu-dock-row-2 .kifu-tool-btn,
.kifu-dock-row-2 .kifu-act-btn {
  font-size: 10.5px;
  color: #e2e8f0;
}

/* Functional visual color coding for instant recognition */
.kifu-controls-deck .kifu-nav-btn.step {
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.4), rgba(15, 23, 42, 0.95));
  border-color: rgba(56, 189, 248, 0.48);
  color: #e0f2fe;
}

.kifu-controls-deck .kifu-tool-btn.undo {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.16), rgba(15, 23, 42, 0.95));
  border-color: rgba(251, 113, 133, 0.34);
  color: #fda4af;
}

.kifu-controls-deck .kifu-tool-btn.accent {
  border-color: rgba(56, 189, 248, 0.42);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.34), rgba(15, 23, 42, 0.94));
  color: #7dd3fc;
}

.kifu-controls-deck .kifu-act-btn.save {
  border-color: rgba(16, 185, 129, 0.48);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.22), rgba(15, 23, 42, 0.95));
  color: #6ee7b7;
}

.kifu-controls-deck .kifu-act-btn.primary {
  border-color: rgba(96, 165, 250, 0.68);
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 3px 10px rgba(37, 99, 235, 0.3);
}

.kifu-controls-deck button:hover:not(:disabled) {
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
}

.kifu-controls-deck .kifu-act-btn.save:hover:not(:disabled) {
  border-color: #34d399;
  color: #ecfdf5;
}

.kifu-controls-deck .kifu-act-btn.primary:hover:not(:disabled) {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
}

.kifu-controls-deck button:active:not(:disabled) {
  transform: scale(0.95);
}

.kifu-controls-deck button:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  box-shadow: none;
}

.kifu-controls-deck button:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 1px;
}

/* Desktop Studio (>= 1024px): Unpack 2 rows into clean 3-section 12-col right deck */
@media (min-width: 1024px) {
  #viewKifu .kifu-topbar,
  #viewKifu .kifu-title-editable {
    padding: 12px 15px !important;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
  }

  #viewKifu.active .kifu-controls-deck {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px 8px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.2);
  }

  #viewKifu.active .kifu-controls-deck .kifu-scrub-row,
  #viewKifu.active .kifu-controls-deck .kifu-comment-row {
    grid-column: 1 / -1 !important;
    padding: 0;
  }

  #viewKifu.active .kifu-controls-deck .kifu-comment-input {
    height: 34px;
    font-size: 12px;
  }

  #viewKifu.active .kifu-dock-row-1,
  #viewKifu.active .kifu-dock-row-2 {
    display: contents;
  }

  /* Row 1: 4 Navigation buttons (3 cols each) */
  #viewKifu.active .kifu-controls-deck .kifu-nav-btn {
    grid-column: span 3;
    height: 54px;
    min-height: 54px;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
  }

  #viewKifu.active .kifu-controls-deck .kifu-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  /* Row 2: 3 Utility tool buttons (4 cols each) */
  #viewKifu.active .kifu-controls-deck .kifu-tool-btn {
    grid-column: span 4;
    height: 42px;
    min-height: 42px;
    flex-direction: row;
    gap: 5px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 2px;
  }

  #viewKifu.active .kifu-controls-deck .kifu-tool-btn svg {
    width: 14px;
    height: 14px;
  }

  /* Rows 3 & 4: 2x2 Action grid (6 cols each) */
  #viewKifu.active .kifu-controls-deck .kifu-act-btn {
    grid-column: span 6;
    height: 52px;
    min-height: 52px;
    flex-direction: row;
    gap: 8px;
    padding: 0 14px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.22);
  }

  #viewKifu.active .kifu-controls-deck .kifu-act-btn svg {
    width: 17px;
    height: 17px;
  }
}

/* 4. FIX Modal Header & Close (✕) Button Alignment + Styling */
.modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.modal-header h3,
.modal-header .modal-title {
  margin: 0 !important;
  font-size: 16.5px;
  font-weight: 800;
  color: #f8fafc;
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.72);
  color: #94a3b8;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

/* 5. Score Input Inline Row (흑/백 [숫자] 집승) */
.kifu-score-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.42);
}

.kifu-score-side {
  font-size: 13px;
  font-weight: 900;
  color: #7dd3fc;
  white-space: nowrap;
}

.kifu-score-box input {
  flex: 1;
  min-height: 34px !important;
  text-align: right;
  font-weight: 800;
}

.kifu-score-unit {
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
}

/* 6. Expanded Saved Kifu List Modal (Show 8~10+ items cleanly at once) */
.kifu-list-modal-card {
  width: min(640px, 94vw) !important;
  max-height: 86vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 18px 20px !important;
}

.kifu-list-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
}

.kifu-list-filter-row input {
  flex: 1;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 13px;
}

.kifu-list-count {
  font-size: 12px;
  font-weight: 800;
  color: #7dd3fc;
  white-space: nowrap;
}

/* Target existing kifu list scroll container */
.kifu-list-modal-card .kifu-saved-list,
.kifu-list-modal-card #kifuListContainer,
#kifuListContainer,
#kifuSavedList {
  flex: 1 1 auto !important;
  min-height: 360px !important;
  max-height: 58vh !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 8px !important;
}

/* Compact 2-line sleek item row so many files fit on screen */
#kifuListContainer .kifu-card,
#kifuSavedList .kifu-saved-item,
.kifu-saved-list .kifu-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
}

#kifuListContainer .kifu-card-title,
#kifuSavedList .kifu-item-title,
.kifu-saved-list .kifu-saved-title {
  font-size: 13.5px !important;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#kifuListContainer .kifu-card-sub,
#kifuSavedList .kifu-item-meta,
.kifu-saved-list .kifu-saved-meta {
  font-size: 11.5px !important;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   Kifu 19x19 Zero-Misclick Aiming Overlay (Mobile 2-Tap & Drag Offset)
   ============================================================================ */
#kifuCanvas {
  display: block;
  touch-action: none;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.kifu-aim-pill {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

.kifu-aim-coord {
  font-size: 13.5px;
  font-weight: 900;
  color: #7dd3fc;
  letter-spacing: 0.4px;
  min-width: 34px;
  text-align: center;
}

.kifu-aim-ok {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #34d399;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.kifu-aim-ok:active {
  transform: scale(0.95);
}

.kifu-aim-cancel {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kifu-aim-cancel:active {
  transform: scale(0.95);
}

/* ============================================================================
   Korea Baduk Association Pro Gibo Button & Browser Modal
   ============================================================================ */
.kifu-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.kifu-meta-left .kifu-meta-title {
  min-width: 0;
  flex: 1;
}

.btn-pro-gibo-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.55);
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.85), rgba(217, 119, 6, 0.9));
  color: #fef08a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.28);
  transition: transform 0.12s ease, filter 0.16s ease, border-color 0.16s ease;
}

.btn-pro-gibo-pill:hover {
  filter: brightness(1.12);
  border-color: #fde047;
  color: #ffffff;
}

.btn-pro-gibo-pill:active {
  transform: scale(0.95);
}

.pro-gibo-modal-card {
  width: 96vw !important;
  max-width: 680px !important;
  max-height: 92dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 18px !important;
  overflow: hidden !important;
}

.pro-gibo-search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.pro-gibo-search-grid select,
.pro-gibo-search-grid input {
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 12.5px;
  min-width: 0;
}

.pro-gibo-search-btn {
  grid-column: 1 / -1;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  background: #334155;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s ease;
}

.pro-gibo-search-btn:hover {
  background: #2563eb;
}

.pro-gibo-quick-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 6px;
  scrollbar-width: none;
}

.pro-gibo-quick-chips::-webkit-scrollbar {
  display: none;
}

.pro-gibo-quick-chips .kifu-chip-btn {
  flex-shrink: 0;
  min-height: 30px;
  padding: 4px 11px;
  font-size: 11.5px;
}

.pro-gibo-list-wrap {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: 62dvh;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
}

/* Desktop Table (hidden on mobile < 820px) */
.pro-gibo-table {
  display: none;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
}

.pro-gibo-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e2a5e;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  white-space: nowrap;
}

.pro-gibo-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  transition: background 0.12s ease;
  cursor: pointer;
}

.pro-gibo-table tbody tr:last-child {
  border-bottom: none;
}

.pro-gibo-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.pro-gibo-table tbody td {
  padding: 10px 10px;
  text-align: center;
  color: #e2e8f0;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-gibo-table td.col-date {
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.pro-gibo-table td.col-title {
  color: #f8fafc;
  font-weight: 600;
}

.pro-gibo-table td.col-result {
  color: #cbd5e1;
  font-size: 13px;
}

.pro-player-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13.5px;
  color: #e2e8f0;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-player-btn:hover {
  background: rgba(148, 163, 184, 0.16);
  text-decoration: underline;
}

.pro-player-btn.pro-player-win {
  color: #60a5fa;
  font-weight: 800;
}

.btn-pro-view-tbl {
  min-width: 68px;
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.pro-gibo-table tbody tr:hover .btn-pro-view-tbl,
.btn-pro-view-tbl:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #2563eb;
  color: #ffffff;
}

.btn-pro-view-tbl:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Mobile Compact Card List (visible on < 820px) */
.pro-gibo-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.pro-gibo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.86);
  min-width: 0;
}

.pro-gibo-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.pro-gibo-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.pro-gibo-date {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.78);
  padding: 2px 6px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

.pro-gibo-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pro-gibo-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
  color: #cbd5e1;
}

.pro-vs {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 700;
}

.pro-player-win {
  color: #60a5fa;
  font-weight: 800;
}

.pro-gibo-result {
  color: #7dd3fc;
  font-weight: 700;
  margin-left: auto;
  font-size: 11.5px;
  white-space: nowrap;
}

.btn-pro-view {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.65), rgba(37, 99, 235, 0.85));
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-pro-view:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* Numbered Pagination Bar (Korea Baduk Association style) */
.pro-gibo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}

.pro-pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: all 0.12s ease;
}

.pro-pg-btn:hover:not(:disabled):not(.active) {
  border-color: rgba(96, 165, 250, 0.6);
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.pro-pg-btn.active {
  border-color: #60a5fa;
  background: #1e2a5e;
  color: #ffffff;
  font-weight: 800;
  cursor: default;
}

.pro-pg-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.pro-pg-mobile-info {
  font-size: 12.5px;
  font-weight: 800;
  color: #cbd5e1;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}

.pro-pg-desktop-only {
  display: none;
}

/* Desktop Clean Table View (>= 820px) */
@media (min-width: 820px) {
  .pro-gibo-modal-card {
    width: min(1080px, 94vw) !important;
    max-width: 1120px !important;
    max-height: 92vh !important;
    padding: 20px 26px !important;
  }

  .pro-gibo-search-grid {
    grid-template-columns: 110px 1fr 1fr 1.35fr 92px;
    gap: 8px;
    max-width: 780px;
    margin: 0 auto 10px auto;
    width: 100%;
  }

  .pro-gibo-search-btn {
    grid-column: auto;
  }

  .pro-gibo-quick-chips {
    justify-content: center;
    margin-bottom: 10px;
  }

  .pro-gibo-list-wrap {
    max-height: 66vh;
  }

  .pro-gibo-table {
    display: table;
  }

  .pro-gibo-mobile-list {
    display: none;
  }

  .pro-pg-desktop-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pro-pg-mobile-only {
    display: none;
  }
}

@keyframes proNextPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); border-color: #38bdf8; }
  50% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); border-color: #fde047; }
}

.pro-next-pulse {
  animation: proNextPulse 0.9s ease-in-out 2;
}

/* ============================================================================
   Streak Stats View Header & Return Button (Opened from Header Streak Badge)
   ============================================================================ */
.tower-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 6px;
}

.tower-topbar-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
}

.btn-tower-back {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-tower-back:hover {
  background: rgba(14, 165, 233, 0.28);
  color: #ffffff;
}

/* ============================================================================
   Baduk News Hub (#viewNews) - Mobile 3x2 / Desktop 6-Button + Unified Feeds
   ============================================================================ */
.news-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 339px) {
  .news-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  .news-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .news-hub-grid .news-hub-btn {
    flex-direction: row;
    min-height: 46px;
    padding: 8px 12px;
    gap: 8px;
  }

  .news-hub-grid .news-hub-lbl {
    font-size: 13px;
  }
}

@media (min-width: 1120px) {
  .news-hub-grid.news-hub-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.news-hub-btn {
  min-height: 56px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.news-hub-btn:hover {
  border-color: rgba(96, 165, 250, 0.55);
  color: #ffffff;
}

.news-hub-btn:active {
  transform: scale(0.97);
}

.news-hub-btn.active {
  border-color: #60a5fa;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.72), rgba(14, 116, 144, 0.45));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.news-hub-ico {
  font-size: 19px;
  line-height: 1;
}

.news-hub-lbl {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.4px;
  text-align: center;
  word-break: keep-all;
}

.news-controls-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.news-ctrl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.news-ctrl-summary {
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
}

.news-ctrl-summary strong {
  color: #60a5fa;
}

.news-search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 220px;
  max-width: 480px;
}

.news-search-form select,
.news-search-form input {
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 12.5px;
}

.news-search-form input {
  flex: 1;
  min-width: 0;
}

.news-search-form button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  background: #2563eb;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.news-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.news-subtabs-primary {
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(30, 42, 94, 0.34);
  border: 1px solid rgba(96, 165, 250, 0.32);
}

.news-subtab-btn {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.news-subtab-btn:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: #ffffff;
}

.news-subtab-btn.active {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

@media (min-width: 820px) {
  .news-subtab-btn {
    min-height: 38px;
    padding: 0 14px;
  }
}

.news-content-area {
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  overflow: hidden;
}

/* Board Desktop Table & Mobile List */
.news-board-table {
  display: none;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
}

.news-board-table thead th {
  background: #1e2a5e;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.news-board-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
  transition: background 0.12s ease;
}

.news-board-table tbody tr:last-child {
  border-bottom: none;
}

.news-board-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.news-board-table tbody tr.is-notice {
  background: rgba(30, 58, 138, 0.18);
}

.news-board-table tbody td {
  padding: 11px 10px;
  color: #e2e8f0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-board-table tbody td.col-left {
  text-align: left;
  font-weight: 600;
  color: #f8fafc;
}

.news-notice-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 800;
}

.news-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.news-mobile-card {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.85);
  cursor: pointer;
}

.news-mobile-card.is-notice {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(30, 58, 138, 0.25);
}

.news-mobile-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.38;
  margin-bottom: 4px;
}

.news-mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #94a3b8;
}

@media (min-width: 780px) {
  .news-board-table {
    display: table;
  }
  .news-mobile-list {
    display: none;
  }
}

/* Pro Ranking Controls, Top 5 Photo Cards & Table */
.news-ym-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.news-year-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.news-year-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
  font-weight: 900;
  cursor: pointer;
}

.news-year-lbl {
  font-size: 16px;
  font-weight: 900;
  color: #fde047;
  min-width: 64px;
  text-align: center;
}

.news-month-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.news-month-pills::-webkit-scrollbar {
  display: none;
}

.news-month-btn {
  flex-shrink: 0;
  min-width: 42px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.75);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.news-month-btn.active {
  background: #1e2a5e;
  border-color: #60a5fa;
  color: #ffffff;
  font-weight: 900;
}

.news-rank-top5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
  background: linear-gradient(135deg, rgba(30, 42, 94, 0.55), rgba(15, 23, 42, 0.75));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.news-rank-hero-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.88);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.news-rank-hero-card.rank-1 {
  border-color: rgba(250, 204, 21, 0.65);
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.14);
}

.news-rank-hero-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

.news-rank-num {
  color: #fde047;
  font-size: 13.5px;
}

.news-rank-photo {
  width: 64px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #1e293b;
}

.news-rank-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
}

.news-rank-score {
  font-size: 13px;
  font-weight: 900;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}

.rank-chg-up   { color: #f87171; font-size: 11.5px; font-weight: 800; }
.rank-chg-down { color: #60a5fa; font-size: 11.5px; font-weight: 800; }
.rank-chg-same { color: #94a3b8; font-size: 11.5px; font-weight: 700; }
.rank-chg-new  { color: #34d399; font-size: 11.5px; font-weight: 800; }

.news-rank-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .news-rank-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
  }
  .news-rank-grid-2 .news-rank-tbl {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    overflow: hidden;
  }
}

.news-rank-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.news-rank-tbl thead th {
  background: #1e2a5e;
  color: #f1f5f9;
  padding: 9px 6px;
  text-align: center;
  font-size: 12px;
}

.news-rank-tbl tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.news-rank-tbl tbody td {
  padding: 8px 6px;
  text-align: center;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

/* Schedule Cards */
.news-sched-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.news-sched-day {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.78);
}

.news-sched-day.is-today {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.14);
}

.news-sched-datecol {
  width: 48px;
  flex-shrink: 0;
  text-align: center;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-sched-d {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
}

.news-sched-w {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.news-sched-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.news-sched-ev {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #e2e8f0;
}

.news-sched-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  margin-top: 2px;
}

.tag-world { background: rgba(245, 158, 11, 0.24); color: #fde047; border: 1px solid rgba(250, 204, 21, 0.45); }
.tag-prd   { background: rgba(56, 189, 248, 0.22); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.45); }
.tag-dev   { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.42); }
.tag-etc   { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }

/* Detail Modal Viewer */
.news-detail-modal-card {
  width: min(880px, 95vw) !important;
  max-width: 880px !important;
  max-height: 90dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 20px !important;
  overflow: hidden !important;
}

.news-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-source-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.news-detail-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
}

.news-detail-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.4;
}

.news-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #94a3b8;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.news-detail-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: rgba(30, 58, 138, 0.24);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.news-detail-file-link {
  color: #93c5fd;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}

.news-detail-file-link:hover {
  text-decoration: underline;
  color: #ffffff;
}

.news-detail-body {
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  word-break: break-word;
}

.news-detail-body img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 8px auto;
  border-radius: 6px;
}

.news-detail-body table {
  max-width: 100%;
  border-collapse: collapse;
}

.news-detail-body a {
  color: #2563eb;
  font-weight: 700;
}

/* Important Badge (KBF Notice) & Attachment Chip */
.news-imp-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(20, 184, 166, 0.22);
  border: 1px solid rgba(45, 212, 191, 0.55);
  color: #5eead4;
  font-size: 11px;
  font-weight: 800;
}

.news-file-chip {
  font-size: 13px;
  color: #fbbf24;
}

/* Kids Baduk News (Naver Blog Card Grid) */
.kids-news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

@media (min-width: 780px) {
  .kids-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
}

.kids-card {
  display: flex;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.85);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
  min-width: 0;
}

.kids-card:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(30, 41, 59, 0.98);
}

.kids-thumb {
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.kids-thumb-empty {
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.kids-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.kids-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kids-card-brief {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kids-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #7dd3fc;
  font-weight: 700;
}

/* Month-by-Month Calm Two-Tone Separation (홀수/짝수 월 블록 교차 구분) */
.news-band-a {
  --band-bg: rgba(15, 23, 42, 0.35);
  --band-hover: rgba(56, 189, 248, 0.08);
  --band-line: rgba(148, 163, 184, 0.35);
  --band-tag-bg: rgba(30, 41, 59, 0.92);
  --band-tag-fg: #e2e8f0;
  --band-tag-bd: rgba(148, 163, 184, 0.36);
}

.news-band-b {
  --band-bg: rgba(51, 65, 85, 0.44);
  --band-hover: rgba(71, 85, 105, 0.58);
  --band-line: rgba(96, 165, 250, 0.55);
  --band-tag-bg: rgba(30, 58, 138, 0.45);
  --band-tag-fg: #bfdbfe;
  --band-tag-bd: rgba(96, 165, 250, 0.45);
}

.news-board-table.news-annual-table tbody tr[class*="news-band-"] {
  background: var(--band-bg);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.news-board-table.news-annual-table tbody tr[class*="news-band-"]:hover {
  background: var(--band-hover);
}

.news-board-table.news-annual-table tbody tr[class*="news-band-"] td:first-child {
  box-shadow: inset 3px 0 0 var(--band-line);
}

.news-board-table.news-annual-table tbody tr.is-month-start:not(:first-child) td {
  border-top: 2px solid rgba(148, 163, 184, 0.34);
}

.news-month-tag {
  display: inline-block;
  min-width: 40px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--band-tag-bg, rgba(30, 41, 59, 0.92));
  border: 1px solid var(--band-tag-bd, rgba(148, 163, 184, 0.35));
  color: var(--band-tag-fg, #e2e8f0);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}

.news-month-cont {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.news-mobile-month-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--band-tag-bg, rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-left: 3px solid var(--band-line, rgba(148, 163, 184, 0.45));
}

.news-mobile-month-hdr:first-child {
  margin-top: 0;
}

.news-mobile-month-cnt {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
}

.news-mobile-card[class*="news-band-"] {
  background: var(--band-bg);
  border-left: 3px solid var(--band-line);
}

.news-mobile-card.news-band-a {
  background: rgba(15, 23, 42, 0.72);
}

.news-mobile-card.news-band-b {
  background: rgba(30, 41, 59, 0.94);
}

/* ============================================================================
   101weiqi Pack Integration (Rank Ladder, Type Focus & Weakness Radar)
   ============================================================================ */
.col-101-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.28), rgba(15, 23, 42, 0.86));
  border: 1px solid rgba(96, 165, 250, 0.34);
}

.col-101-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: #e2e8f0;
}

.col-101-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.28);
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
}

.col-101-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.col-101-type-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.col-101-type-btn:hover {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.25);
}

.col-101-type-btn.active {
  border-color: #93c5fd;
  background: #2563eb;
  color: #ffffff;
}

.col-101-type-btn.is-weak {
  border-color: rgba(251, 191, 36, 0.6);
  color: #fde68a;
}

@media (min-width: 820px) {
  .col-101-type-btn {
    min-height: 36px;
  }
}

.btn-101-promote {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(52, 211, 153, 0.65);
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.tower-101-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tower-101-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.tower-101-rank-chip {
  min-height: 32px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.tower-101-rank-chip.unlocked {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.42);
}

.tower-101-rank-chip.done {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}

.tower-101-rank-chip.active {
  background: #2563eb;
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.tower-101-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 460px) {
  .tower-101-types {
    grid-template-columns: 1fr;
  }
}

.tower-101-type-card {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tower-101-type-card.is-weak {
  border-color: rgba(251, 191, 36, 0.52);
  background: rgba(180, 83, 9, 0.14);
}

.tower-101-type-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: #f1f5f9;
}

.tower-101-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.75);
  overflow: hidden;
}

.tower-101-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #38bdf8;
}

.tower-101-type-card.is-weak .tower-101-bar-fill {
  background: #fbbf24;
}

/* ============================================================================
   Today Solved Problems History Button & Modal
   ============================================================================ */
.stat-box.stat-box-btn {
  text-align: left;
  font-family: inherit;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.stat-box.stat-box-btn:hover {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(30, 41, 59, 0.92);
}
.stat-box.stat-box-btn:active { transform: scale(0.98); }

.stat-link-pill {
  margin-top: 5px;
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
}

.today-log-entry-bar {
  display: flex;
}

.btn-today-log {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(56, 189, 248, 0.14));
  color: #e0f2fe;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-today-log:hover {
  border-color: #7dd3fc;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(56, 189, 248, 0.22));
}
.btn-today-log:active { transform: scale(0.98); }

.today-log-modal-card {
  max-width: 640px;
  width: min(640px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

.today-log-summary {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.today-log-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.today-log-filter {
  flex: 1;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.today-log-filter.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

.today-log-list {
  flex: 1;
  min-height: 160px;
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.today-log-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.today-log-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.today-log-row.is-right { border-left: 3px solid #22c55e; }
.today-log-row.is-wrong { border-left: 3px solid #ef4444; }

.today-log-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.today-log-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  margin-top: 1px;
}
.today-log-badge.is-right { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.45); }
.today-log-badge.is-wrong { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); }

.today-log-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.42;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.today-log-folder {
  color: #7dd3fc;
  font-weight: 800;
}
.today-log-sep {
  color: #64748b;
  margin: 0 3px;
}
.today-log-prob {
  color: #f8fafc;
  font-weight: 700;
}

.today-log-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}

.today-log-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  min-width: 0;
  flex: 1;
  font-size: 11px;
  color: #94a3b8;
}

.today-log-grade {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(51, 65, 85, 0.75);
  color: #e2e8f0;
  font-weight: 700;
}

.today-log-history {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
}
.today-log-ox { letter-spacing: 0.5px; }
.today-log-acc { color: #93c5fd; font-weight: 800; }

.btn-log-replay {
  flex-shrink: 0;
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-log-replay:hover { background: rgba(56, 189, 248, 0.25); }
.btn-log-replay:active { transform: scale(0.95); }

/* ============================================================================
   Multi-User Auth Gate, Header User/Rank Chips, Admin Panel & 101 Rank Exam
   ============================================================================ */
.header-exam-btn,
.header-admin-btn,
.header-user-btn {
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.header-exam-btn {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.14);
  color: #fde047;
}
.header-admin-btn {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
}
.header-admin-btn.is-teacher {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
.admin-pending-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
}
.user-rank-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-size: 10.5px;
  font-weight: 800;
}
.user-rank-pill.is-certified {
  background: rgba(250, 204, 21, 0.22);
  border-color: rgba(250, 204, 21, 0.65);
  color: #fde047;
}
@media (max-width: 560px) {
  .top-header {
    padding: 6px 8px;
    gap: 5px;
  }
  .brand-title {
    font-size: 13.5px;
  }
  .mode-badge {
    display: none;
  }
  .header-actions {
    gap: 4px;
  }
  .header-exam-btn { display: none; }
  .header-user-btn {
    padding: 3px 7px;
    font-size: 11px;
    min-height: 30px;
    gap: 4px;
  }
  .header-admin-btn {
    padding: 3px 7px;
    font-size: 11px;
    min-height: 30px;
  }
  .streak-pill {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 30px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: radial-gradient(circle at top, rgba(30, 58, 138, 0.92), rgba(15, 23, 42, 0.98));
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.auth-gate-overlay.hidden { display: none !important; }

.auth-card {
  width: min(460px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #131d33;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  padding: 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-brand-title { font-size: 20px; font-weight: 900; color: #f8fafc; }
.auth-brand-sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.auth-alert {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.auth-alert.is-error { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.45); color: #fca5a5; }
.auth-alert.is-success { background: rgba(34, 197, 94, 0.16); border: 1px solid rgba(34, 197, 94, 0.45); color: #86efac; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.auth-tab-btn {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.auth-tab-btn.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

.auth-section-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #7dd3fc;
  margin: 8px 0;
}
.auth-form-stack { display: flex; flex-direction: column; gap: 10px; }
.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 440px) {
  .auth-form-grid { grid-template-columns: 1fr; }
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}
.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: #f8fafc;
  font-size: 13px;
  box-sizing: border-box;
}
.auth-check-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
  font-size: 12.5px;
  color: #e2e8f0;
  cursor: pointer;
}
.auth-remember-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 2px 2px 4px;
}
.auth-remember-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}
.auth-remember-item input {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
  cursor: pointer;
}
.saved-accounts-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.22);
}
.saved-accounts-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}
.saved-accounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.saved-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.saved-account-chip.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}
.saved-account-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-size: 10px;
  line-height: 1;
}
.saved-account-del:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.auth-sub-box {
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.auth-hint {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.45;
}

/* Profile Modal */
.profile-modal-card { max-width: 520px; width: min(520px, 94vw); }
.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.profile-hero-name { font-size: 15px; font-weight: 900; color: #f8fafc; display: flex; align-items: center; gap: 6px; }
.profile-hero-cert { font-size: 12px; color: #fde047; margin-top: 3px; font-weight: 700; }
.prof-role-pill {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}
.prof-role-pill.is-admin { background: rgba(168, 85, 247, 0.25); color: #e9d5ff; }
.prof-role-pill.is-teacher { background: rgba(16, 185, 129, 0.24); color: #6ee7b7; }
.prof-role-pill.is-student { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.btn-exam-cta {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, 0.55);
  background: rgba(250, 204, 21, 0.16);
  color: #fde047;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.prof-data-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11.5px;
  color: #cbd5e1;
}
.btn-danger-soft {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* Admin Modal */
.admin-modal-card {
  max-width: 640px;
  width: min(640px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-pending-banner {
  font-size: 12.5px;
  font-weight: 800;
  color: #fde047;
}
.btn-admin-refresh {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.admin-user-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
}
.admin-user-row {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.admin-user-row.st-pending { border-left: 3px solid #facc15; }
.admin-user-row.st-approved { border-left: 3px solid #22c55e; }
.admin-user-row.st-revoked { border-left: 3px solid #ef4444; opacity: 0.85; }
.admin-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-user-name { font-size: 13.5px; font-weight: 800; color: #f8fafc; }
.admin-status-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.admin-status-pill.pending { background: rgba(250, 204, 21, 0.2); color: #fde047; }
.admin-status-pill.approved { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.admin-status-pill.revoked { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.admin-user-meta { font-size: 11.5px; color: #94a3b8; display: flex; flex-wrap: wrap; gap: 8px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-adm {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.btn-adm.approve { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.5); color: #86efac; }
.btn-adm.revoke  { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.5); color: #fcd34d; }
.btn-adm.delete  { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
.btn-adm.rank    { background: rgba(250, 204, 21, 0.16); border-color: rgba(250, 204, 21, 0.45); color: #fde047; }
.btn-adm.hw      { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.5); color: #6ee7b7; }
.admin-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 7px 10px;
  margin-bottom: 9px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
}
.role-leg-item b { color: #f8fafc; }
.adm-username-at { font-weight: 600; font-size: 11.5px; color: #94a3b8; }
.adm-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: middle;
}
.adm-role-pill.is-admin   { background: rgba(168, 85, 247, 0.24); border: 1px solid rgba(168, 85, 247, 0.5); color: #e9d5ff; }
.adm-role-pill.is-teacher { background: rgba(16, 185, 129, 0.22); border: 1px solid rgba(16, 185, 129, 0.5); color: #6ee7b7; }
.adm-role-pill.is-member  { background: rgba(56, 189, 248, 0.18); border: 1px solid rgba(56, 189, 248, 0.4); color: #7dd3fc; }
.adm-role-wrap { display: inline-flex; align-items: center; }
.adm-role-select {
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: rgba(30, 41, 59, 0.92);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.adm-self-tag { font-size: 11px; color: #94a3b8; align-self: center; font-weight: 700; }

/* 101weiqi Rank Promotion Exam Modal */
.rank-exam-card {
  max-width: 560px;
  width: min(560px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
}
.exam-cert-banner {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.exam-rules-box {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.5;
}
.exam-rank-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 420px) {
  .exam-rank-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.exam-rank-chip {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.exam-rank-chip.passed { border-color: rgba(34, 197, 94, 0.55); background: rgba(34, 197, 94, 0.14); color: #86efac; }
.exam-rank-chip.recommended { border-color: rgba(250, 204, 21, 0.55); }
.exam-rank-chip.active { background: #2563eb; border-color: #60a5fa; color: #fff; box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35); }
.exam-history-list { display: flex; flex-direction: column; gap: 5px; max-height: 150px; overflow-y: auto; }
.exam-hist-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 14px 8px; }
.exam-hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  font-size: 12px;
}
.exam-hist-meta { font-size: 11px; color: #94a3b8; }
.exam-res-pill { padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; }
.exam-res-pill.pass { background: rgba(34, 197, 94, 0.22); color: #4ade80; }
.exam-res-pill.fail { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }

.exam-play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 6px;
}
.exam-play-timer { color: #38bdf8; font-variant-numeric: tabular-nums; }
.exam-play-timer.is-danger { color: #f87171; }
.exam-timer-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  overflow: hidden;
  margin-bottom: 8px;
}
.exam-timer-fill { height: 100%; background: linear-gradient(90deg, #38bdf8, #34d399); transition: width 0.25s linear; }
.exam-timer-fill.is-danger { background: linear-gradient(90deg, #f97316, #ef4444); }
.exam-dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.exam-dot {
  height: 24px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-dot.is-current { border-color: #38bdf8; color: #38bdf8; background: rgba(56, 189, 248, 0.16); }
.exam-dot.is-right { background: rgba(34, 197, 94, 0.25); border-color: #22c55e; color: #4ade80; }
.exam-dot.is-wrong { background: rgba(239, 68, 68, 0.25); border-color: #ef4444; color: #fca5a5; }
.exam-board-stage {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 52vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exam-board-stage canvas { width: 100%; height: 100%; display: block; border-radius: 10px; }
.exam-aim-bar {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 800;
}
.exam-status-strip {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.exam-status-strip.is-right { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.exam-status-strip.is-wrong { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.exam-result-hero { text-align: center; padding: 12px 8px; }
.exam-res-icon { font-size: 42px; }
.exam-res-title { font-size: 17px; font-weight: 900; color: #f8fafc; margin-top: 4px; }
.exam-res-sub { font-size: 12.5px; color: #94a3b8; margin-top: 4px; }
.exam-res-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.exam-res-cell {
  padding: 7px 4px;
  border-radius: 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.exam-res-cell.is-right { border-color: rgba(34, 197, 94, 0.5); }
.exam-res-cell.is-wrong { border-color: rgba(239, 68, 68, 0.5); }

/* Mobile & Inline 101 Rank Exam CTAs */
.col-101-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-101-exam-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.18));
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-101-exam-inline:active { transform: scale(0.97); }
.btn-101-exam-full {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.26), rgba(234, 88, 12, 0.2));
  color: #fef3c7;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.btn-101-exam-full:active { transform: scale(0.985); }

/* 101 Rank Exam Post-Exam Solution Review */
.exam-res-hint {
  margin: 4px 0 6px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #bae6fd;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}
button.exam-res-cell {
  width: 100%;
  min-height: 62px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
button.exam-res-cell:hover {
  background: rgba(30, 41, 59, 0.95);
}
button.exam-res-cell:active {
  transform: scale(0.96);
}
.exam-res-tap {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #93c5fd;
  margin-top: 1px;
}
.exam-res-cell.is-wrong .exam-res-tap {
  color: #fca5a5;
}
.btn-exam-review-wrong {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border: none;
  font-weight: 800;
}
.exam-dot.is-clickable {
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.exam-review-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.exam-review-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.btn-exam-rev {
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.btn-exam-rev.is-accent {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(22, 163, 74, 0.25);
  color: #bbf7d0;
}
.btn-exam-rev.is-primary {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(2, 132, 199, 0.28);
  color: #e0f2fe;
}
.btn-exam-rev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================================
   v65 Features: Real-Time Leaderboard, 30-Day Heatmap & Weakness Report,
   and Admin Member Coaching & ⭐ Bookmarks Viewer
   ============================================================================ */
.lb-head,
.hm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.lb-refresh-btn {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.lb-sort-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}
.lb-sort-btn {
  min-height: 36px;
  padding: 4px 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.lb-sort-btn.active {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border-color: #60a5fa;
  color: #ffffff;
}
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.lb-row.is-first {
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.12), rgba(15, 23, 42, 0.85));
}
.lb-row.is-me {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}
.lb-pos {
  width: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  color: #94a3b8;
  flex-shrink: 0;
}
.lb-info {
  flex: 1;
  min-width: 0;
}
.lb-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.lb-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}
.lb-me-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 800;
}
.lb-rank-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.8);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
}
.lb-rank-pill.is-cert {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
.lb-sub-line {
  margin-top: 3px;
  font-size: 11px;
  color: #94a3b8;
}
.lb-metric {
  text-align: right;
  flex-shrink: 0;
}
.lb-metric-val {
  font-size: 13.5px;
  font-weight: 900;
  color: #f8fafc;
  white-space: nowrap;
}
.lb-metric-sub {
  font-size: 10.5px;
  color: #38bdf8;
  font-weight: 700;
  white-space: nowrap;
}

/* 30-Day Attendance Heatmap */
.hm-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.hm-kpi {
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11.5px;
  color: #cbd5e1;
}
.hm-kpi strong { color: #f8fafc; }
.hm-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
}
.hm-cell {
  aspect-ratio: 1 / 1;
  min-height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hm-cell:active { transform: scale(0.92); }
.hm-day-num {
  font-size: 10px;
  font-weight: 800;
  color: rgba(241, 245, 249, 0.78);
}
.hm-lv-0 { background: rgba(30, 41, 59, 0.85); }
.hm-lv-0 .hm-day-num { color: #64748b; }
.hm-lv-1 { background: #064e3b; border-color: #047857; }
.hm-lv-2 { background: #059669; border-color: #10b981; }
.hm-lv-3 { background: #10b981; border-color: #34d399; }
.hm-lv-3 .hm-day-num { color: #052e16; }
.hm-lv-4 { background: #34d399; border-color: #6ee7b7; }
.hm-lv-4 .hm-day-num { color: #052e16; }
.hm-cell.is-today { box-shadow: 0 0 0 2px #facc15; }
.hm-cell.is-selected { box-shadow: 0 0 0 2px #38bdf8; }
.hm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.hm-readout {
  font-size: 11.5px;
  color: #cbd5e1;
}
.hm-readout strong { color: #38bdf8; }
.hm-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: #94a3b8;
}
.hm-sw {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

/* Weakness Report Bars */
.wk-divider {
  height: 1px;
  background: rgba(51, 65, 85, 0.7);
  margin: 13px 0 11px;
}
.wk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wk-row {
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.wk-row.is-focus {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.wk-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}
.wk-label { color: #f1f5f9; }
.wk-label small { color: #94a3b8; font-weight: 700; }
.wk-stat.is-weak { color: #fbbf24; }
.wk-stat.is-mid { color: #38bdf8; }
.wk-stat.is-strong { color: #4ade80; }
.wk-stat.is-empty { color: #64748b; }
.wk-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.75);
  overflow: hidden;
}
.wk-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.wk-bar-fill.is-weak { background: linear-gradient(90deg, #f97316, #fbbf24); }
.wk-bar-fill.is-mid { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.wk-bar-fill.is-strong { background: linear-gradient(90deg, #16a34a, #4ade80); }
.wk-coach-tip {
  margin-top: 9px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.45;
}
.wk-coach-tip strong { color: #fde68a; }
.btn-weak-focus {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.22));
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.btn-weak-focus:active { transform: scale(0.985); }

/* Admin Coaching & ⭐ Bookmarks Viewer */
.btn-adm.coach {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.22));
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
}
.admin-bm-hot { color: #fbbf24 !important; }
.admin-coach-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-coach-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 9px;
}
.coach-kpi {
  padding: 7px 6px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
}
.coach-kpi-lbl { font-size: 10px; color: #94a3b8; font-weight: 700; }
.coach-kpi-val { font-size: 13.5px; font-weight: 900; color: #f8fafc; margin: 2px 0; }
.coach-kpi-sub { font-size: 10px; color: #cbd5e1; }
.admin-coach-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 9px;
}
.admin-coach-tab {
  min-height: 38px;
  padding: 5px 6px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.admin-coach-tab.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}
.admin-coach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 2px;
}
.today-log-row.is-bookmark { border-left: 3px solid #f59e0b; }
.today-log-badge.is-bookmark {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.5);
}
.btn-log-replay.is-coach {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.18);
  color: #fef3c7;
}
@media (max-width: 440px) {
  .admin-coach-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================================
   v68 Kifu Upgrades: Captures HUD, Scrubber/±10/Auto-Play, Comment Bar,
   and 100-Move Split Print Selector
   ============================================================================ */
.kifu-meta-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.kifu-captures-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.kifu-scrub-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 2px;
}
.kifu-mini-btn {
  min-width: 34px;
  min-height: 30px;
  padding: 0 7px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
.kifu-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.kifu-mini-btn:active:not(:disabled) { transform: scale(0.94); }
.kifu-mini-btn.is-play {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
}
.kifu-mini-btn.is-play.is-playing {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
}
.kifu-mini-btn.is-speed {
  color: #93c5fd;
  font-variant-numeric: tabular-nums;
}
.kifu-step-slider {
  flex: 1;
  min-width: 0;
  height: 22px;
  accent-color: #38bdf8;
  cursor: pointer;
}
.kifu-comment-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 3px;
}
.kifu-comment-ico {
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.8;
}
.kifu-comment-input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.78);
  color: #f1f5f9;
  font-size: 11.5px;
  font-family: inherit;
  outline: none;
}
.kifu-comment-input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.95);
}
.kifu-comment-row.has-comment .kifu-comment-input {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.1);
  color: #fef3c7;
}
.print-range-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.print-range-pill {
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.92);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.print-range-pill.active {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border-color: #60a5fa;
  color: #ffffff;
}

/* ============================================================================
   v69 Kifu Advanced Study Modes (Variation / Next-Move Quiz / Score / Coach)
   ============================================================================ */
.kifu-mode-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 3px;
  background: rgba(15, 23, 42, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  flex-shrink: 0;
}
.kifu-mode-chip {
  flex: 1;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.78);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.kifu-mode-chip.active-var {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(34, 211, 238, 0.78);
  color: #a5f3fc;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25);
}
.kifu-mode-chip.active-quiz {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.8);
  color: #fde68a;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}
.kifu-mode-chip.active-score {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.8);
  color: #a7f3d0;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25);
}

.kifu-coach-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.28), rgba(37, 99, 235, 0.25));
  border-bottom: 1px solid rgba(167, 139, 250, 0.45);
  font-size: 11.5px;
  font-weight: 800;
  color: #ede9fe;
  flex-shrink: 0;
}
.kifu-coach-banner-info {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kifu-coach-banner-acts {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.kifu-active-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 11.5px;
  flex-shrink: 0;
}
.kifu-active-banner.mode-var {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.24), rgba(15, 23, 42, 0.92));
  border-bottom-color: rgba(34, 211, 238, 0.45);
}
.kifu-active-banner.mode-quiz {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.26), rgba(15, 23, 42, 0.92));
  border-bottom-color: rgba(251, 191, 36, 0.48);
}
.kifu-active-banner.mode-score {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.24), rgba(15, 23, 42, 0.92));
  border-bottom-color: rgba(52, 211, 153, 0.48);
}
.kifu-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.kifu-banner-title {
  font-weight: 800;
  color: #f8fafc;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kifu-banner-sub {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.3;
}
.kifu-banner-sub.is-hit { color: #86efac; font-weight: 700; }
.kifu-banner-sub.is-close { color: #fde68a; font-weight: 700; }
.kifu-banner-sub.is-miss { color: #fca5a5; font-weight: 700; }
.kifu-banner-acts {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.kifu-banner-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.86);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.kifu-banner-btn.is-accent {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
}
.kifu-banner-btn.is-save {
  border-color: rgba(52, 211, 153, 0.72);
  background: rgba(16, 185, 129, 0.26);
  color: #d1fae5;
}
.kifu-banner-btn.is-warn {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(245, 158, 11, 0.22);
  color: #fef3c7;
}
.kifu-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: #e2e8f0;
  flex-wrap: wrap;
}
.kifu-score-verdict {
  font-weight: 900;
  color: #6ee7b7;
}
.admin-coach-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.admin-coach-tab {
  padding: 7px 4px;
  font-size: 11px;
}
.coach-kifu-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
  margin-left: 4px;
}

/* ============================================================================
   v70 Cute "소이 사활" Header Logo (Jua Rounded Font + Kawaii Go Stones SVG)
   ============================================================================ */
.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(253, 224, 71, 0.28);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  line-height: 1;
  user-select: none;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
html[data-theme] .brand-title {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.brand-title:hover {
  border-color: rgba(253, 224, 71, 0.55);
}
.brand-title:active {
  transform: scale(0.96);
}
.brand-stones-svg,
.brand-icon-svg {
  width: 31px;
  height: 31px;
  flex-shrink: 0;
  border-radius: 7px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.brand-stones-svg .stone-sparkle {
  transform-origin: 21.5px 4.6px;
  animation: ggSparkleTwinkle 2.8s ease-in-out infinite;
}
.brand-title:hover .stone-b {
  transform-origin: 14px 16px;
  animation: ggStoneWiggle 0.55s ease-in-out;
}
.brand-title:hover .stone-w {
  transform-origin: 29px 16px;
  animation: ggStoneWiggle 0.55s ease-in-out 0.08s;
}
@keyframes ggSparkleTwinkle {
  0%, 100% { opacity: 0.72; transform: scale(0.92) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.16) rotate(14deg); }
}
@keyframes ggStoneWiggle {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  35% { transform: rotate(-7deg) translateY(-1.6px); }
  70% { transform: rotate(5deg) translateY(-0.6px); }
}
.brand-t-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 1.5px;
}
.brand-sub {
  font-family: 'Plus Jakarta Sans', 'Noto Sans KR', sans-serif;
  font-size: 8.8px;
  font-weight: 800;
  letter-spacing: 1.1px;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}
.brand-default-stack .brand-sub {
  color: #93c5fd;
  opacity: 0.92;
}
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: 'Jua', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 20.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-word-soi {
  background: linear-gradient(180deg, #fff9db 0%, #fde047 58%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.75));
}
.brand-word-sahwal {
  background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 55%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.75));
}
@media (max-width: 560px) {
  .brand-title {
    gap: 5px;
    padding: 3px 9px 3px 5px;
  }
  html[data-theme] .brand-title {
    padding: 0;
  }
  .brand-stones-svg,
  .brand-icon-svg {
    width: 26px;
    height: 26px;
  }
  .brand-wordmark {
    font-size: 18px;
    gap: 1.5px;
  }
  .brand-sub {
    font-size: 7.5px;
    letter-spacing: 0.85px;
  }
}

/* ============================================================================
   v71 KataGo AI Analysis UI (Winrate Gauge, Top Moves, Winrate Graph, Config)
   ============================================================================ */
.kifu-mode-chip.active-ai {
  background: rgba(139, 92, 246, 0.26);
  border-color: rgba(167, 139, 250, 0.85);
  color: #ede9fe;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.28);
}
.kifu-active-banner.mode-ai {
  background: linear-gradient(90deg, rgba(109, 40, 217, 0.26), rgba(15, 23, 42, 0.94));
  border-bottom-color: rgba(167, 139, 250, 0.5);
}
.ai-winrate-bar-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  height: 28px;
  min-height: 28px;
}
.ai-winrate-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  min-height: 15px;
  line-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-wr-black { color: #e2e8f0; }
.ai-wr-score { color: #fde047; font-size: 11px; }
.ai-wr-white { color: #bae6fd; }
.ai-winrate-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.4);
}
.ai-winrate-track.is-dim {
  opacity: 0.35;
}
.ai-winrate-fill-b {
  height: 100%;
  background: linear-gradient(90deg, #0f172a, #334155);
  transition: width 0.28s ease;
}
.ai-winrate-fill-w {
  flex: 1;
  height: 100%;
  background: linear-gradient(90deg, #e2e8f0, #ffffff);
}
.ai-tools-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
  height: 26px;
  gap: 5px;
  margin-top: 2px;
}
.ai-tools-row::-webkit-scrollbar { display: none; }
.ai-tools-row .kifu-banner-btn {
  flex-shrink: 0;
}
.ai-live-dot {
  font-size: 10px;
  font-weight: 700;
  color: #f59e0b;
}
.ai-visits-tag {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.72;
}
.ai-move-grade-pill {
  font-size: 11px;
  font-weight: 800;
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
}
.ai-move-grade-pill.is-placeholder {
  background: rgba(148, 163, 184, 0.12);
  border: 1px dashed rgba(148, 163, 184, 0.32);
  color: #94a3b8;
  font-weight: 700;
}
.ai-move-grade-pill.is-good {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #15803d;
}
.ai-move-grade-pill.is-ok {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #0369a1;
}
.ai-move-grade-pill.is-warn {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.52);
  color: #b45309;
}
.ai-move-grade-pill.is-blunder {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #b91c1c;
}
.ai-moves-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
  height: 26px;
  min-height: 26px;
  gap: 4px;
  padding-bottom: 1px;
}
.ai-chips-placeholder {
  font-size: 11px;
  opacity: 0.72;
  white-space: nowrap;
}
.ai-pv-action-row {
  display: flex;
  margin-top: 2px;
}
.ai-pv-var-btn {
  width: 100%;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(6, 182, 212, 0.55);
  background: rgba(6, 182, 212, 0.16);
  color: #0e7490;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.ai-pv-var-btn.is-inline {
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-pv-var-btn:hover {
  background: rgba(6, 182, 212, 0.26);
}
.ai-moves-chips::-webkit-scrollbar { display: none; }
.ai-move-chip {
  flex-shrink: 0;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.ai-move-chip.is-best {
  border-color: rgba(34, 211, 238, 0.72);
  color: #a5f3fc;
}
.ai-move-chip.selected {
  background: rgba(6, 182, 212, 0.28);
  border-color: #22d3ee;
  color: #ffffff;
}
.ai-graph-box {
  margin-top: 3px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.ai-winrate-svg {
  width: 100%;
  height: 72px;
  display: block;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.ai-graph-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.45);
}
.ai-graph-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fde047;
}
.ai-graph-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}
.ai-graph-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  transition: width 0.2s ease;
}
.ai-blunder-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.ai-blunder-nav-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-blunder-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.ai-blunder-chips::-webkit-scrollbar { display: none; }
.ai-blunder-chip {
  flex-shrink: 0;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ai-blunder-chip.is-active {
  background: #ef4444;
  border-color: #ffffff;
  color: #ffffff;
}
.ai-graph-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}
.ai-mode-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ai-mode-seg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.ai-mode-seg-btn small {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.78;
}
.ai-mode-seg-btn.active {
  border-color: #FFED00;
  background: rgba(255, 237, 0, 0.16);
  color: #fde047;
}
.ai-visits-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.ai-visits-chip {
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.ai-visits-chip.active {
  background: #FFED00;
  border-color: #141414;
  color: #141414;
  font-weight: 800;
}
.ai-visits-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-visits-slider-row input[type="range"] {
  flex: 1;
}
.ai-visits-num {
  width: 78px !important;
  flex-shrink: 0;
  text-align: center;
  font-weight: 800;
}
.ai-device-guide {
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11px;
  line-height: 1.45;
  color: #cbd5e1;
}
.ai-device-guide code {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  padding: 0 4px;
  border-radius: 4px;
}
.kifu-ai-config-card {
  max-width: 440px;
}
.ai-status-box {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.75);
  color: #e2e8f0;
  line-height: 1.45;
}
.ai-status-box.is-ok {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.14);
  color: #a7f3d0;
}
.ai-status-box.is-err {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}
.ai-config-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.ai-config-row {
  display: flex;
  gap: 8px;
}
.ai-guide-box {
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11.5px;
  line-height: 1.55;
  color: #cbd5e1;
}
.ai-guide-box code {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10.5px;
}
.btn-adm.kifu {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(167, 139, 250, 0.55);
  color: #ede9fe;
}
.btn-adm.kifu:hover {
  background: rgba(139, 92, 246, 0.34);
}

/* ============================================================================
   v79: Sanbon Dojo Friends (#viewDojo) & Web Push Settings UI
   ============================================================================ */
.push-settings-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-top: 6px;
}
.push-status-text {
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  color: #94a3b8;
}
.push-settings-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#viewDojo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dojo-subtabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: rgba(15, 23, 42, 0.72);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.dojo-subtab-btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 6px;
  transition: all 0.16s ease;
}
.dojo-subtab-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(59, 130, 246, 0.24));
  border-color: rgba(56, 189, 248, 0.55);
  color: #f8fafc;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.18);
}
.dojo-subtab-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}
.dojo-subtab-btn.active .dojo-subtab-badge {
  background: rgba(56, 189, 248, 0.3);
  color: #e0f2fe;
}

.dojo-push-card {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.78);
}
.dojo-push-card.is-nudge {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.52), rgba(15, 23, 42, 0.88));
  border-color: rgba(56, 189, 248, 0.52);
}
.dojo-push-card.is-on {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.42), rgba(15, 23, 42, 0.85));
  border-color: rgba(52, 211, 153, 0.48);
}
.dojo-push-card.is-ios {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.4), rgba(15, 23, 42, 0.85));
  border-color: rgba(251, 191, 36, 0.5);
}
.dojo-push-card.is-warn {
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(251, 113, 133, 0.45);
}
.dojo-push-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.dojo-push-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.dojo-push-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dojo-push-desc {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #cbd5e1;
}
.dojo-push-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
}
.dojo-push-chip.is-green {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}
.dojo-push-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.dojo-cta-btn {
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
}
.dojo-cta-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.dojo-mini-btn {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.dojo-mini-btn.primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: rgba(96, 165, 250, 0.65);
  color: #ffffff;
}
.dojo-mini-btn.is-warn {
  background: rgba(180, 83, 9, 0.35);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}
.dojo-mini-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dojo-content-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 14px;
}

.dojo-hero-card {
  border-radius: 18px;
  padding: 15px;
  background: linear-gradient(150deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dojo-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dojo-hero-ring-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dojo-rings-svg {
  display: block;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.16));
}
.dojo-hero-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dojo-hero-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dojo-hero-name {
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
}
.dojo-rank-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #7dd3fc;
}
.dojo-hidden-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}
.dojo-closed-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

.dojo-ring-metrics {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dojo-metric-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
}
.dojo-metric-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dojo-metric-row.is-solve .dot { background: #f43f5e; }
.dojo-metric-row.is-right .dot { background: #22c55e; }
.dojo-metric-row.is-streak .dot { background: #38bdf8; }
.dojo-metric-row .lbl { width: 28px; color: #94a3b8; font-weight: 700; }
.dojo-metric-row b { color: #f8fafc; font-weight: 800; }
.dojo-metric-row .pct {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
}

.dojo-hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}
.dojo-7d-wrap {
  flex: 1;
  min-width: 170px;
}
.dojo-7d-label {
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  margin-bottom: 5px;
}
.dojo-7d-label small { color: #94a3b8; font-weight: 600; }
.dojo-7d-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
}
.dojo-7d-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.dojo-7d-track {
  width: 100%;
  max-width: 22px;
  height: 32px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 1px;
}
.dojo-7d-bar {
  width: 100%;
  border-radius: 3px;
  background: rgba(100, 116, 139, 0.35);
}
.dojo-7d-bar.is-active {
  background: linear-gradient(180deg, #38bdf8, #2563eb);
}
.dojo-7d-bar.is-closed {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}
.dojo-7d-bar.is-today {
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
}
.dojo-7d-dow {
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 700;
}
.dojo-7d-dow.is-today { color: #38bdf8; font-weight: 900; }

.dojo-hero-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dojo-goal-editor {
  padding: 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dojo-goal-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #e0f2fe;
}
.dojo-goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.dojo-goal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}
.dojo-goal-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}
.dojo-goal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dojo-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.dojo-badge-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.34);
  color: #fde68a;
}

.dojo-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.dojo-section-title {
  font-size: 14px;
  font-weight: 900;
  color: #f8fafc;
}
.dojo-section-sub {
  font-size: 11px;
  color: #94a3b8;
}

.dojo-friends-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 780px) {
  .dojo-friends-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dojo-friend-card {
  border-radius: 16px;
  padding: 13px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dojo-friend-card.is-all-closed {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.14);
}
.dojo-friend-card.is-hidden-card {
  opacity: 0.78;
}
.dojo-friend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dojo-friend-id {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.dojo-friend-name {
  font-size: 14.5px;
  font-weight: 900;
  color: #f8fafc;
}
.dojo-mute-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.dojo-mute-btn.is-muted {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
}
.dojo-friend-hidden-msg {
  font-size: 12px;
  color: #94a3b8;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.55);
}

.dojo-friend-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dojo-friend-ring { flex-shrink: 0; }
.dojo-friend-stats {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dojo-mini-metrics {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  font-weight: 700;
}
.dojo-mini-metrics .m-solve { color: #fda4af; }
.dojo-mini-metrics .m-right { color: #86efac; }
.dojo-mini-metrics .m-streak { color: #7dd3fc; }

.dojo-cheer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.dojo-cheer-chip {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(30, 41, 59, 0.78);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.dojo-cheer-chip:active { transform: scale(0.96); }
.dojo-cheer-chip.is-custom {
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.dojo-custom-cheer-row {
  display: flex;
  gap: 6px;
}
.dojo-custom-cheer-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
}

.dojo-cheers-card {
  border-radius: 16px;
  padding: 13px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dojo-cheers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dojo-cheer-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dojo-cheer-meta {
  font-size: 11px;
  color: #94a3b8;
}
.dojo-cheer-meta b { color: #e2e8f0; }
.dojo-cheer-time { margin-left: 6px; font-size: 10px; color: #64748b; }
.dojo-cheer-msg { font-size: 12.5px; font-weight: 700; color: #f8fafc; }

.dojo-loading-box,
.dojo-empty-note {
  padding: 20px 14px;
  border-radius: 14px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.25);
}
.dojo-loading-box.is-err { color: #fda4af; border-color: rgba(244, 63, 94, 0.45); }

.dojo-roadmap-card {
  border-radius: 18px;
  padding: 18px 16px;
  background: linear-gradient(150deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dojo-roadmap-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}
.dojo-roadmap-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
}
.dojo-roadmap-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
}
.dojo-roadmap-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2e8f0;
}

/* ============================================================================
   v80: Phase 2 — 7-Day Duel UI (Apple Fitness 1:1 Competition Mode)
   ============================================================================ */
.dojo-subtab-badge.is-alert {
  background: rgba(244, 63, 94, 0.34);
  color: #fecdd3;
}
.dojo-subtab-badge.is-live {
  background: rgba(34, 197, 94, 0.28);
  color: #bbf7d0;
}

.dojo-friend-head-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.dojo-h2h-mini {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.38);
  color: #e9d5ff;
}
.dojo-duel-qbtn {
  border: 1px solid rgba(56, 189, 248, 0.48);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.dojo-duel-qbtn.is-live {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}
.dojo-duel-qbtn.is-alert {
  border-color: rgba(251, 113, 133, 0.65);
  background: rgba(244, 63, 94, 0.28);
  color: #fecdd3;
}
.dojo-duel-qbtn.is-wait {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.duel-summary-card {
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(250, 204, 21, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.duel-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.duel-summary-title {
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
}
.duel-summary-record {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rec-win { color: #4ade80; }
.rec-loss { color: #fda4af; }
.rec-draw { color: #94a3b8; }
.duel-trophy-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
}
.duel-rules-strip {
  font-size: 11.5px;
  line-height: 1.45;
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.duel-section-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.duel-invite-card {
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(159, 18, 57, 0.34), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(251, 113, 133, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.duel-invite-card.is-outgoing {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(251, 191, 36, 0.4);
}
.duel-invite-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}
.duel-invite-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #cbd5e1;
}
.duel-invite-btns {
  display: flex;
  gap: 6px;
}

.duel-active-card {
  border-radius: 18px;
  padding: 15px;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.86));
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.duel-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.duel-period-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.duel-live-pill {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f43f5e, #f97316);
  color: #ffffff;
}
.duel-period-text {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
}
.duel-h2h-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.duel-vs-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.duel-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.duel-side.is-me { align-items: flex-start; }
.duel-side.is-opp { align-items: flex-end; text-align: right; }
.duel-side-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
}
.duel-opp-rk {
  font-size: 10px;
  color: #7dd3fc;
}
.duel-side-score {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  color: #f8fafc;
}
.duel-side.is-me .duel-side-score { color: #38bdf8; }
.duel-side.is-opp .duel-side-score { color: #fb7185; }
.duel-side-score small {
  font-size: 12px;
  font-weight: 700;
  margin-left: 2px;
  color: #94a3b8;
}
.duel-side-today {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}
.duel-vs-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(51, 65, 85, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #f8fafc;
}

.duel-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.duel-bar-row {
  display: grid;
  grid-template-columns: 52px 1fr 78px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}
.duel-bar-name {
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.duel-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.duel-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.duel-bar-fill.is-me { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.duel-bar-fill.is-opp { background: linear-gradient(90deg, #e11d48, #fb7185); }
.duel-bar-max {
  text-align: right;
  font-size: 10.5px;
  color: #94a3b8;
}

.duel-lead-banner {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.duel-lead-banner.is-lead {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #86efac;
}
.duel-lead-banner.is-trail {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}
.duel-lead-banner.is-tie {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

.duel-daily-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.duel-daily-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #cbd5e1;
}
.duel-daily-title small { color: #94a3b8; font-weight: 600; }
.duel-daily-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.duel-day-cell {
  border-radius: 9px;
  padding: 6px 2px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.duel-day-cell.is-today {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.12);
}
.duel-day-cell.is-future { opacity: 0.48; }
.duel-day-hd {
  font-size: 10px;
  font-weight: 800;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.duel-day-hd small { font-size: 9px; color: #94a3b8; font-weight: 600; }
.duel-day-val {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
}
.duel-day-val.my.is-win { color: #38bdf8; }
.duel-day-val.opp.is-win { color: #fb7185; }

.duel-goals-footnote {
  font-size: 10.5px;
  color: #94a3b8;
  text-align: center;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.duel-friends-list,
.duel-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.duel-friend-row,
.duel-history-row {
  border-radius: 14px;
  padding: 11px 13px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.duel-friend-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: #f8fafc;
}
.duel-friend-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #94a3b8;
}
.duel-friend-sub b { color: #e2e8f0; }
.duel-state-chip.is-live {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #86efac;
}
.duel-outcome-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 4px;
}
.duel-outcome-badge.is-win { background: rgba(250, 204, 21, 0.2); color: #fde047; }
.duel-outcome-badge.is-loss { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.duel-outcome-badge.is-draw { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.duel-history-title { font-size: 13px; color: #f8fafc; }
.duel-history-sub { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }
.duel-history-score { font-size: 13.5px; color: #cbd5e1; font-weight: 700; }
.duel-history-score b { color: #38bdf8; font-weight: 900; }

/* ============================================================================
   v81: Phase 3 — Weekly Point League, Dojo Coop Mission & Live Feed
   ============================================================================ */
.league-mission-card {
  border-radius: 18px;
  padding: 15px;
  background: linear-gradient(145deg, rgba(124, 45, 18, 0.34), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(251, 146, 60, 0.5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.league-mission-card.is-complete {
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.45), rgba(15, 23, 42, 0.94));
  border-color: rgba(52, 211, 153, 0.65);
}
.mission-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mission-title {
  font-size: 14.5px;
  font-weight: 900;
  color: #f8fafc;
}
.mission-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #cbd5e1;
}
.mission-head-btns {
  display: flex;
  gap: 6px;
}
.mission-big-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.mission-cur {
  font-size: 28px;
  font-weight: 900;
  color: #fb923c;
  line-height: 1;
}
.league-mission-card.is-complete .mission-cur { color: #4ade80; }
.mission-sep {
  font-size: 13.5px;
  font-weight: 700;
  color: #94a3b8;
}
.mission-pct-pill {
  margin-left: auto;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 146, 60, 0.22);
  border: 1px solid rgba(251, 146, 60, 0.48);
  color: #fed7aa;
}
.league-mission-card.is-complete .mission-pct-pill {
  background: rgba(34, 197, 94, 0.24);
  border-color: rgba(74, 222, 128, 0.55);
  color: #bbf7d0;
}
.mission-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mission-bar-track {
  height: 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.mission-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #facc15, #4ade80);
  transition: width 0.35s ease;
}
.mission-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
}
.mission-contrib-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mission-contrib-chip {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
.mission-contrib-chip b { color: #fde68a; }
.mission-contrib-empty { font-size: 11px; color: #94a3b8; }
.mission-goal-editor {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11.5px;
  color: #e2e8f0;
}
.mission-goal-editor input {
  width: 84px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: #0f172a;
  color: #f8fafc;
  font-weight: 800;
}

.league-board-card,
.feed-timeline-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.league-rules-strip {
  font-size: 11.5px;
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.league-rules-strip b { color: #fde047; }

.league-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.league-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.league-rank-row.is-me {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.5);
}
.league-rank-row.is-first {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.12);
}
.league-rank-num {
  width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  color: #cbd5e1;
  flex-shrink: 0;
}
.league-rank-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.league-rank-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: #f8fafc;
}
.league-breakdown {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.35;
}
.league-breakdown b { color: #e2e8f0; }
.league-rank-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.league-pts-val {
  font-size: 17px;
  font-weight: 900;
  color: #fde047;
  line-height: 1;
}
.league-pts-val small {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  margin-left: 2px;
}
.league-me-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
}
.league-poke-btn {
  border: 1px solid rgba(251, 146, 60, 0.45);
  background: rgba(249, 115, 22, 0.18);
  color: #fed7aa;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.league-poke-btn:active { transform: scale(0.95); }

.feed-notif-banner {
  border-radius: 14px;
  padding: 11px 13px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.36), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(192, 132, 252, 0.48);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.feed-notif-title {
  font-size: 12px;
  font-weight: 900;
  color: #e9d5ff;
}
.feed-notif-line {
  font-size: 12px;
  color: #f8fafc;
}
.feed-notif-line small {
  margin-left: 6px;
  font-size: 10px;
  color: #94a3b8;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-item-card {
  border-radius: 13px;
  padding: 11px 12px;
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-item-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.feed-item-ico {
  font-size: 20px;
  line-height: 1.1;
  flex-shrink: 0;
}
.feed-item-body {
  flex: 1;
  min-width: 0;
}
.feed-item-text {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.4;
}
.feed-item-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #cbd5e1;
}
.feed-item-time {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}
.feed-react-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.feed-react-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}
.feed-react-btn:active { transform: scale(0.95); }
.feed-react-btn.is-active {
  background: rgba(14, 165, 233, 0.24);
  border-color: rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
}
.feed-react-who {
  font-size: 10.5px;
  color: #94a3b8;
}

/* ============================================================================
   v82: 6-Theme Full-UI Personalization & Dynamic Header Brand System
   ============================================================================ */

/* Settings Visual 6-Theme Picker Grid */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 10px;
}
@media (min-width: 520px) {
  .theme-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.theme-opt-card {
  position: relative;
  text-align: left;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.theme-opt-card:active { transform: scale(0.97); }
.theme-opt-card.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
.theme-opt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.theme-opt-ico { font-size: 16px; line-height: 1; }
.theme-opt-swatches {
  display: inline-flex;
  gap: 3px;
}
.theme-opt-swatches i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.theme-opt-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
}
.theme-opt-desc {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.3;
}
.theme-opt-check {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1120;
}

/* --- 5 Custom Header Brand Styles (v97: Unified SANBON BADUK + Larger Scale) --- */
.brand-t-kaya {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 7px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(180, 126, 56, 0.28), rgba(45, 31, 20, 0.88));
  border: 1px solid rgba(245, 193, 108, 0.56);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.brand-t-kaya .brand-t-txt {
  font-family: 'Gowun Batang', serif;
  font-size: 19.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.05;
}
.brand-t-kaya .w1 { color: #fde68a; }
.brand-t-kaya .w2 { color: #fefce8; }
.brand-t-kaya .brand-sub { color: #e7c28a; }

.brand-t-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px 3px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(249, 168, 212, 0.5);
  box-shadow: 0 2px 12px rgba(244, 114, 182, 0.16);
}
.brand-t-cat .brand-t-txt {
  font-family: 'Jua', sans-serif;
  font-size: 20.5px;
  letter-spacing: 0.3px;
  line-height: 1;
}
.brand-t-cat .w1 {
  background: linear-gradient(135deg, #fda4af, #fde047);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-t-cat .w2 {
  background: linear-gradient(135deg, #7dd3fc, #ddd6fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-t-cat .brand-sub { color: #fbcfe8; }

.brand-t-pro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 6px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(34, 211, 238, 0.34);
}
.brand-t-pro .brand-t-txt {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1.05;
}
.brand-t-pro .w1 { color: #f8fafc; }
.brand-t-pro .w2 {
  background: linear-gradient(90deg, #22d3ee, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-t-pro .tag {
  font-size: 9px;
  font-weight: 900;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.2);
  color: #67e8f9;
  margin-left: 3px;
  letter-spacing: 0.5px;
}
.brand-t-pro .brand-sub { color: #67e8f9; }

.brand-t-seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 11px 3px 6px;
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.72);
  border: 1px solid rgba(234, 179, 8, 0.35);
}
.brand-t-seal .seal-stamp {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(145deg, #dc2626, #991b1b);
  border: 1.5px solid #fca5a5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Gowun Batang', serif;
  font-size: 16px;
  font-weight: 700;
  color: #fef2f2;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.42);
  flex-shrink: 0;
}
.brand-t-seal .brand-t-txt {
  font-family: 'Gowun Batang', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #f5f5f4;
  line-height: 1.05;
}
.brand-t-seal .brand-sub { color: #facc15; opacity: 0.88; }

.brand-t-champion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 7px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.78), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(250, 204, 21, 0.62);
  box-shadow: 0 3px 12px rgba(250, 204, 21, 0.18);
}
.brand-t-champion .brand-t-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 1.5px;
}
.brand-t-champion .main {
  font-family: 'Jua', sans-serif;
  font-size: 19.5px;
  color: #fef08a;
  letter-spacing: 0.25px;
}
.brand-t-champion .sub {
  font-family: 'Plus Jakarta Sans', 'Noto Sans KR', sans-serif;
  font-size: 8.8px;
  font-weight: 800;
  color: #c4b5fd;
  letter-spacing: 1.1px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .brand-t-kaya,
  .brand-t-cat,
  .brand-t-pro,
  .brand-t-seal,
  .brand-t-champion {
    gap: 6px;
    padding: 3px 9px 3px 5px;
  }
  .brand-t-kaya .brand-t-txt,
  .brand-t-pro .brand-t-txt,
  .brand-t-seal .brand-t-txt,
  .brand-t-champion .main {
    font-size: 17px;
  }
  .brand-t-cat .brand-t-txt {
    font-size: 18px;
  }
  .brand-t-champion .sub {
    font-size: 7.5px;
    letter-spacing: 0.85px;
  }
  .brand-t-seal .seal-stamp {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
}

/* ============================================================================
   THEME A: kaya — 비자나무 도장 (Warm Walnut & Honey Gold)
   ============================================================================ */
html[data-theme="kaya"] {
  --bg: #1b130d;
  --surface: #2a1e15;
  --surface-2: #39291c;
  --border: #573e29;
  --text: #fef7e7;
  --muted: #cbb597;
  --accent: #f59e0b;
  --emerald: #34d399;
  --gold: #fde047;
}
html[data-theme="kaya"] .top-header {
  background: linear-gradient(180deg, #2b1e14, #1e150e) !important;
  background-color: #2b1e14 !important;
  border-bottom-color: rgba(245, 193, 108, 0.34) !important;
}
html[data-theme="kaya"] .bottom-nav {
  background: #17100a !important;
  border-color: rgba(245, 193, 108, 0.28) !important;
}
html[data-theme="kaya"] .nav-tab.active,
html[data-theme="kaya"] .bottom-nav .nav-tab.active {
  color: #fde68a !important;
  background: rgba(245, 158, 11, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 193, 108, 0.45);
}
html[data-theme="kaya"] .play-meta-bar,
html[data-theme="kaya"] .kifu-meta-bar,
html[data-theme="kaya"] .kifu-controls,
html[data-theme="kaya"] .action-bar,
html[data-theme="kaya"] .comment-strip,
html[data-theme="kaya"] .prob-history-strip {
  background: rgba(42, 30, 21, 0.88) !important;
  border-color: rgba(217, 165, 92, 0.28) !important;
}
html[data-theme="kaya"] .board-stage,
html[data-theme="kaya"] .kifu-board-stage {
  background: radial-gradient(circle at center, rgba(78, 52, 28, 0.58), rgba(27, 19, 13, 0.88)) !important;
  border-color: rgba(245, 193, 108, 0.34) !important;
}
html[data-theme="kaya"] .modal-card,
html[data-theme="kaya"] .dojo-hero-card,
html[data-theme="kaya"] .dojo-friend-card,
html[data-theme="kaya"] .dojo-cheers-card,
html[data-theme="kaya"] .duel-active-card,
html[data-theme="kaya"] .duel-summary-card,
html[data-theme="kaya"] .league-board-card,
html[data-theme="kaya"] .feed-timeline-card,
html[data-theme="kaya"] .col-current-card,
html[data-theme="kaya"] .folder-item,
html[data-theme="kaya"] .tower-card,
html[data-theme="kaya"] .card-box {
  background: linear-gradient(150deg, rgba(46, 33, 22, 0.94), rgba(30, 21, 14, 0.96)) !important;
  border-color: rgba(217, 165, 92, 0.32) !important;
}
html[data-theme="kaya"] .dojo-subtabs {
  background: rgba(24, 16, 10, 0.85) !important;
  border-color: rgba(217, 165, 92, 0.28) !important;
}
html[data-theme="kaya"] .dojo-subtab-btn.active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.36), rgba(180, 83, 9, 0.32)) !important;
  border-color: rgba(251, 191, 36, 0.62) !important;
}
html[data-theme="kaya"] .act-btn.primary,
html[data-theme="kaya"] .btn-safe-primary,
html[data-theme="kaya"] .dojo-cta-btn,
html[data-theme="kaya"] .dojo-mini-btn.primary {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  border-color: rgba(253, 224, 71, 0.55) !important;
  color: #fffbeb !important;
}
html[data-theme="kaya"] .modal-title,
html[data-theme="kaya"] .dojo-hero-name,
html[data-theme="kaya"] .dojo-section-title {
  font-family: 'Gowun Batang', serif;
  color: #fef3c7;
}

/* ============================================================================
   THEME B: cat — 귀염 고양이 바둑돌 (Soft Lavender-Berry Pastel & Rounded UI)
   ============================================================================ */
html[data-theme="cat"] {
  --bg: #19122a;
  --surface: #271d42;
  --surface-2: #352759;
  --border: #4e3b7a;
  --text: #fdf4ff;
  --muted: #c4b5fd;
  --accent: #f472b6;
  --emerald: #4ade80;
  --gold: #fde047;
}
html[data-theme="cat"] .top-header {
  background: linear-gradient(180deg, #271b45, #1b1330) !important;
  background-color: #271b45 !important;
  border-bottom-color: rgba(249, 168, 212, 0.32) !important;
}
html[data-theme="cat"] .bottom-nav {
  background: #140e24 !important;
  border-color: rgba(196, 181, 253, 0.25) !important;
}
html[data-theme="cat"] .nav-tab.active,
html[data-theme="cat"] .bottom-nav .nav-tab.active {
  color: #f9a8d4 !important;
  background: rgba(244, 114, 182, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.48);
}
html[data-theme="cat"] .play-meta-bar,
html[data-theme="cat"] .kifu-meta-bar,
html[data-theme="cat"] .kifu-controls,
html[data-theme="cat"] .action-bar,
html[data-theme="cat"] .comment-strip,
html[data-theme="cat"] .prob-history-strip {
  background: rgba(41, 29, 69, 0.88) !important;
  border-color: rgba(196, 181, 253, 0.28) !important;
  border-radius: 16px;
}
html[data-theme="cat"] .board-stage,
html[data-theme="cat"] .kifu-board-stage {
  background: radial-gradient(circle at center, rgba(76, 48, 128, 0.45), rgba(25, 18, 42, 0.9)) !important;
  border-color: rgba(249, 168, 212, 0.34) !important;
  border-radius: 22px !important;
}
html[data-theme="cat"] .modal-card,
html[data-theme="cat"] .dojo-hero-card,
html[data-theme="cat"] .dojo-friend-card,
html[data-theme="cat"] .dojo-cheers-card,
html[data-theme="cat"] .duel-active-card,
html[data-theme="cat"] .duel-summary-card,
html[data-theme="cat"] .league-board-card,
html[data-theme="cat"] .feed-timeline-card,
html[data-theme="cat"] .col-current-card,
html[data-theme="cat"] .folder-item,
html[data-theme="cat"] .tower-card,
html[data-theme="cat"] .card-box {
  background: linear-gradient(150deg, rgba(44, 31, 74, 0.92), rgba(28, 20, 48, 0.95)) !important;
  border-color: rgba(244, 114, 182, 0.3) !important;
  border-radius: 20px !important;
}
html[data-theme="cat"] .dojo-subtabs {
  background: rgba(22, 15, 38, 0.88) !important;
  border-color: rgba(244, 114, 182, 0.28) !important;
  border-radius: 18px !important;
}
html[data-theme="cat"] .dojo-subtab-btn.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.36), rgba(139, 92, 246, 0.34)) !important;
  border-color: rgba(249, 168, 212, 0.65) !important;
}
html[data-theme="cat"] .act-btn,
html[data-theme="cat"] .dojo-mini-btn {
  border-radius: 14px !important;
}
html[data-theme="cat"] .act-btn.primary,
html[data-theme="cat"] .btn-safe-primary,
html[data-theme="cat"] .dojo-cta-btn,
html[data-theme="cat"] .dojo-mini-btn.primary {
  background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
  border-color: rgba(249, 168, 212, 0.65) !important;
  color: #ffffff !important;
}
html[data-theme="cat"] .modal-title,
html[data-theme="cat"] .dojo-hero-name,
html[data-theme="cat"] .dojo-section-title,
html[data-theme="cat"] .mission-title {
  font-family: 'Jua', sans-serif;
  letter-spacing: 0.2px;
}

/* ============================================================================
   THEME C: pro — 미니멀 프로 스튜디오 (Carbon Slate & Electric Cyan)
   ============================================================================ */
html[data-theme="pro"] {
  --bg: #090b10;
  --surface: #131722;
  --surface-2: #1c2231;
  --border: #283044;
  --text: #f8fafc;
  --muted: #8b98b2;
  --accent: #22d3ee;
  --emerald: #10b981;
  --gold: #38bdf8;
}
html[data-theme="pro"] body {
  font-family: 'Noto Sans KR', 'Plus Jakarta Sans', -apple-system, sans-serif;
}
html[data-theme="pro"] .top-header {
  background: #0c0f16 !important;
  border-bottom-color: rgba(34, 211, 238, 0.22) !important;
}
html[data-theme="pro"] .bottom-nav {
  background: #07090d !important;
  border-color: rgba(40, 48, 68, 0.9) !important;
}
html[data-theme="pro"] .nav-tab.active,
html[data-theme="pro"] .bottom-nav .nav-tab.active {
  color: #22d3ee !important;
  background: rgba(34, 211, 238, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.45);
}
html[data-theme="pro"] .play-meta-bar,
html[data-theme="pro"] .kifu-meta-bar,
html[data-theme="pro"] .kifu-controls,
html[data-theme="pro"] .action-bar,
html[data-theme="pro"] .modal-card,
html[data-theme="pro"] .dojo-hero-card,
html[data-theme="pro"] .dojo-friend-card,
html[data-theme="pro"] .dojo-cheers-card,
html[data-theme="pro"] .duel-active-card,
html[data-theme="pro"] .duel-summary-card,
html[data-theme="pro"] .league-board-card,
html[data-theme="pro"] .feed-timeline-card,
html[data-theme="pro"] .col-current-card,
html[data-theme="pro"] .folder-item,
html[data-theme="pro"] .tower-card,
html[data-theme="pro"] .card-box {
  background: #121620 !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  border-radius: 12px !important;
}
html[data-theme="pro"] .board-stage,
html[data-theme="pro"] .kifu-board-stage {
  background: #0d1018 !important;
  border-color: rgba(34, 211, 238, 0.22) !important;
}
html[data-theme="pro"] .act-btn.primary,
html[data-theme="pro"] .btn-safe-primary,
html[data-theme="pro"] .dojo-cta-btn,
html[data-theme="pro"] .dojo-mini-btn.primary {
  background: linear-gradient(135deg, #06b6d4, #4f46e5) !important;
  border-color: rgba(103, 232, 249, 0.55) !important;
  color: #ffffff !important;
}

/* ============================================================================
   THEME D: seal — 전통 낙관 & 명인전 (Sumi-Ink Charcoal, Vermilion & Gold)
   ============================================================================ */
html[data-theme="seal"] {
  --bg: #111214;
  --surface: #1c1d21;
  --surface-2: #27292f;
  --border: #3a3d45;
  --text: #f5f5f4;
  --muted: #a8a29e;
  --accent: #ef4444;
  --emerald: #22c55e;
  --gold: #eab308;
}
html[data-theme="seal"] .top-header {
  background: linear-gradient(180deg, #1b1c20, #121316) !important;
  background-color: #1b1c20 !important;
  border-bottom: 1.5px solid rgba(220, 38, 38, 0.42) !important;
}
html[data-theme="seal"] .bottom-nav {
  background: #0e0f11 !important;
  border-color: rgba(168, 162, 158, 0.22) !important;
}
html[data-theme="seal"] .nav-tab.active,
html[data-theme="seal"] .bottom-nav .nav-tab.active {
  color: #fca5a5 !important;
  background: rgba(220, 38, 38, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.48);
}
html[data-theme="seal"] .play-meta-bar,
html[data-theme="seal"] .kifu-meta-bar,
html[data-theme="seal"] .kifu-controls,
html[data-theme="seal"] .action-bar,
html[data-theme="seal"] .modal-card,
html[data-theme="seal"] .dojo-hero-card,
html[data-theme="seal"] .dojo-friend-card,
html[data-theme="seal"] .dojo-cheers-card,
html[data-theme="seal"] .duel-active-card,
html[data-theme="seal"] .duel-summary-card,
html[data-theme="seal"] .league-board-card,
html[data-theme="seal"] .feed-timeline-card,
html[data-theme="seal"] .col-current-card,
html[data-theme="seal"] .folder-item,
html[data-theme="seal"] .tower-card,
html[data-theme="seal"] .card-box {
  background: linear-gradient(160deg, rgba(30, 31, 36, 0.96), rgba(20, 21, 24, 0.98)) !important;
  border-color: rgba(234, 179, 8, 0.26) !important;
}
html[data-theme="seal"] .dojo-subtab-btn.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.34), rgba(153, 27, 27, 0.34)) !important;
  border-color: rgba(248, 113, 113, 0.58) !important;
}
html[data-theme="seal"] .act-btn.primary,
html[data-theme="seal"] .btn-safe-primary,
html[data-theme="seal"] .dojo-cta-btn,
html[data-theme="seal"] .dojo-mini-btn.primary {
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
  border-color: rgba(252, 165, 165, 0.55) !important;
  color: #fef2f2 !important;
}
html[data-theme="seal"] .modal-title,
html[data-theme="seal"] .dojo-hero-name,
html[data-theme="seal"] .dojo-section-title,
html[data-theme="seal"] .mission-title {
  font-family: 'Gowun Batang', serif;
  letter-spacing: 0.4px;
}

/* ============================================================================
   THEME E: champion — 50연승 챔피언 (Royal Indigo, Trophy Gold & Arena Purple)
   ============================================================================ */
html[data-theme="champion"] {
  --bg: #0c0f24;
  --surface: #171c3d;
  --surface-2: #222959;
  --border: #3a4282;
  --text: #f8fafc;
  --muted: #a5b4fc;
  --accent: #facc15;
  --emerald: #34d399;
  --gold: #fde047;
}
html[data-theme="champion"] .top-header {
  background: linear-gradient(180deg, #1b1f48, #0f132e) !important;
  background-color: #1b1f48 !important;
  border-bottom: 1.5px solid rgba(250, 204, 21, 0.36) !important;
}
html[data-theme="champion"] .bottom-nav {
  background: #090b1c !important;
  border-color: rgba(129, 140, 248, 0.28) !important;
}
html[data-theme="champion"] .nav-tab.active,
html[data-theme="champion"] .bottom-nav .nav-tab.active {
  color: #fde047 !important;
  background: rgba(250, 204, 21, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.5);
}
html[data-theme="champion"] .play-meta-bar,
html[data-theme="champion"] .kifu-meta-bar,
html[data-theme="champion"] .kifu-controls,
html[data-theme="champion"] .action-bar,
html[data-theme="champion"] .modal-card,
html[data-theme="champion"] .dojo-hero-card,
html[data-theme="champion"] .dojo-friend-card,
html[data-theme="champion"] .dojo-cheers-card,
html[data-theme="champion"] .duel-active-card,
html[data-theme="champion"] .duel-summary-card,
html[data-theme="champion"] .league-board-card,
html[data-theme="champion"] .feed-timeline-card,
html[data-theme="champion"] .col-current-card,
html[data-theme="champion"] .folder-item,
html[data-theme="champion"] .tower-card,
html[data-theme="champion"] .card-box {
  background: linear-gradient(150deg, rgba(28, 34, 77, 0.9), rgba(14, 18, 43, 0.95)) !important;
  border-color: rgba(168, 85, 247, 0.36) !important;
  box-shadow: 0 8px 24px rgba(15, 12, 48, 0.45);
}
html[data-theme="champion"] .dojo-subtab-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.38), rgba(234, 179, 8, 0.28)) !important;
  border-color: rgba(250, 204, 21, 0.6) !important;
}
html[data-theme="champion"] .act-btn.primary,
html[data-theme="champion"] .btn-safe-primary,
html[data-theme="champion"] .dojo-cta-btn,
html[data-theme="champion"] .dojo-mini-btn.primary {
  background: linear-gradient(135deg, #7c3aed, #d97706) !important;
  border-color: rgba(250, 204, 21, 0.62) !important;
  color: #ffffff !important;
}
html[data-theme="champion"] .board-stage,
html[data-theme="champion"] .kifu-board-stage {
  background: radial-gradient(circle at center, rgba(67, 56, 202, 0.35), rgba(12, 15, 36, 0.92)) !important;
  border-color: rgba(250, 204, 21, 0.34) !important;
}

/* ============================================================================
   v87: Streamlined Apple-Settings-Style Settings Modal & iOS Toggle Switches
   ============================================================================ */
.settings-modal-card {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px) !important;
  max-width: 440px !important;
  width: 94vw !important;
}

.settings-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px;
  background: rgba(11, 17, 32, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
}
.settings-hdr-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}
.settings-hdr-right {
  display: flex;
  align-items: center;
  gap: 7px;
}
.settings-help-chip {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.settings-x-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.85);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-body {
  padding: 12px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.settings-grp {
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-grp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
}
.settings-grp-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}

/* Compact 3x2 Theme Tiles (Clean 1-line labels, zero wrapping) */
.theme-picker-grid.compact-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.theme-tile {
  padding: 8px 4px 7px;
  border-radius: 11px;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: transform 0.12s ease, border-color 0.16s ease, background 0.16s ease;
}
.theme-tile:active { transform: scale(0.96); }
.theme-tile.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 0 1.5px rgba(56, 189, 248, 0.28);
}
.theme-tile-label {
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.25px;
}
.theme-tile-bar {
  width: 34px;
  height: 5px;
  border-radius: 999px;
}

.s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
}
.settings-grp .s-row + .s-row,
.s-adv-body .s-row + .s-row {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
}
.s-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Segmented Control (2-Tap vs 1-Tap) */
.seg-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(11, 17, 32, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn.active {
  background: var(--accent);
  color: #0b1120;
}

/* Modern iOS Toggle Switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ios-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.28);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.ios-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}
.ios-switch input:checked + .ios-slider {
  background: #22c55e;
  border-color: rgba(74, 222, 128, 0.65);
}
.ios-switch input:checked + .ios-slider::after {
  transform: translateX(20px);
}
.ios-switch input:disabled + .ios-slider {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Collapsible Advanced Study Settings & Theme Group */
.s-grp-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
}
.s-grp-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.s-grp-toggle-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.s-grp-arrow {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.s-theme-body {
  margin-top: 10px;
}
.s-adv-wrap {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.s-adv-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  cursor: pointer;
}
.s-adv-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.s-num-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
}
.s-num-pair input {
  width: 64px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(11, 17, 32, 0.85);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
  text-align: center;
}
.s-select {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(11, 17, 32, 0.88);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  max-width: 175px;
}

.s-push-note {
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--muted);
}
.s-mini-chip {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.16);
  color: var(--accent);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.s-mini-chip:disabled { opacity: 0.42; cursor: not-allowed; }

.s-fireworks-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.28), rgba(30, 41, 59, 0.72));
  color: #fde68a;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.s-fireworks-btn:active { transform: scale(0.98); }

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(11, 17, 32, 0.85);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
}
.settings-sync-line {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s-done-btn {
  padding: 7px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0b1120;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================================
   v90: Problem Report Button, Moved Turn Indicator & Multi-User Comment Modal
   ============================================================================ */
.btn-report-prob {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.36);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.btn-report-prob:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(251, 113, 133, 0.62);
}
.btn-report-prob:active { transform: scale(0.95); }
.btn-report-prob.has-activity {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
}
.btn-report-prob.has-report {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(251, 113, 133, 0.72);
  color: #fecdd3;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.22);
}
.btn-report-prob .rep-cnt {
  font-size: 10.5px;
  font-weight: 900;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
}

.status-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}
.turn-group.in-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-turn-sep {
  color: rgba(148, 163, 184, 0.4);
  font-weight: 400;
  flex-shrink: 0;
}

.prob-report-modal-card {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px) !important;
  max-width: 480px !important;
  width: 94vw !important;
}

.rep-tabs-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(11, 17, 32, 0.7);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  flex-shrink: 0;
}
.rep-tab-btn {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.65);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.rep-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #f8fafc;
}

.rep-modal-body {
  padding: 12px 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.rep-prob-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rep-prob-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}
.rep-prob-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rep-status-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.rep-status-pill.is-open {
  background: rgba(244, 63, 94, 0.22);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #fecdd3;
}
.rep-status-pill.is-resolved {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}
.rep-admin-status-btn {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.rep-section {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rep-sec-title {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--text);
}

.rep-reason-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.rep-reason-chip {
  padding: 7px 6px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.rep-reason-chip.active {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(251, 113, 133, 0.68);
  color: #fff;
}

.rep-input-row {
  display: flex;
  gap: 6px;
}
.rep-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(11, 17, 32, 0.88);
  color: #f8fafc;
  font-size: 12px;
}
.rep-submit-btn {
  padding: 0 13px;
  min-height: 36px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.rep-submit-btn.is-danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
}
.rep-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.rep-list,
.rep-all-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rep-item {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rep-item.is-report {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(159, 18, 57, 0.16);
}
.rep-item.is-admin-cmt {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(14, 165, 233, 0.12);
}
.rep-item.is-teacher-cmt {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
}
.rep-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #f8fafc;
}
.rep-reason-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.25);
  color: #fecdd3;
}
.rep-rank {
  font-size: 10px;
  font-weight: 700;
  color: #7dd3fc;
}
.rep-time {
  font-size: 10px;
  color: #94a3b8;
  margin-left: auto;
}
.rep-del-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}
.rep-del-btn:hover { color: #fda4af; }
.rep-item-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2e8f0;
  word-break: break-word;
}
.rep-empty,
.rep-empty-sm {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 14px 10px;
}
.rep-empty-sm { padding: 8px 6px; font-size: 11.5px; }

.rep-all-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rep-all-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.rep-all-title {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.35;
  word-break: break-word;
}
.rep-open-prob-btn {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.rep-all-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rep-all-preview {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

/* ============================================================================
   v91: Desktop Live Comments Dock (Underneath 50 Streak Tower & Today Stats)
   ============================================================================ */
.play-tower-stats-mount {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}
.play-tower-stats-mount > * {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  flex-shrink: 0;
  overflow: hidden;
}

.desktop-comments-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 210px !important;
  min-height: 210px !important;
  padding: 12px !important;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden !important;
}
.dock-cmt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}
.dock-cmt-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--text);
  flex-wrap: wrap;
}
.dock-cmt-num {
  color: var(--accent);
  font-weight: 800;
}
.dock-cmt-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 999px;
}
.dock-cmt-badge.is-warn {
  background: rgba(244, 63, 94, 0.22);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #fecdd3;
}
.dock-cmt-badge.is-ok {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}
.dock-cmt-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dock-cmt-mini {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.dock-cmt-mini.is-rep {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
}

.dock-cmt-list {
  flex: 1 1 auto;
  min-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.dock-cmt-empty {
  margin: auto;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  padding: 14px 8px;
}
.dock-cmt-item {
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}
.dock-cmt-item.is-report {
  background: rgba(159, 18, 57, 0.18);
  border-color: rgba(251, 113, 133, 0.36);
}
.dock-cmt-item.is-admin {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.42);
}
.dock-cmt-item.is-teacher {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.42);
}
.dock-cmt-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text);
}
.dock-cmt-time {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--muted);
}
.dock-cmt-text {
  font-size: 12px;
  line-height: 1.42;
  color: #e2e8f0;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}

.dock-cmt-form {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.dock-cmt-input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(11, 17, 32, 0.88);
  color: #f8fafc;
  font-size: 12px;
}
.dock-cmt-send {
  padding: 0 12px;
  min-height: 34px;
  border-radius: 9px;
  border: none;
  background: var(--accent);
  color: #0b1120;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.dock-cmt-send:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================================
   v92: Admin Problem Reports Manager & Fixed ("수정 완료") Status UI
   ============================================================================ */
.btn-report-prob.is-resolved {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.65);
  color: #a7f3d0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.btn-report-prob.is-resolved:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(52, 211, 153, 0.85);
}

.dock-cmt-mini.is-ok {
  border-color: rgba(52, 211, 153, 0.52);
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
}
.dock-resolved-banner {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.48);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dock-resolved-head {
  font-size: 11.5px;
  font-weight: 900;
  color: #a7f3d0;
}
.dock-resolved-head span {
  font-weight: 600;
  font-size: 10px;
  color: #6ee7b7;
}
.dock-resolved-note {
  font-size: 11.5px;
  line-height: 1.4;
  color: #ecfdf5;
}
.dock-cmt-item.is-report.is-fixed,
.rep-item.is-report.is-fixed {
  opacity: 0.78;
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(15, 23, 42, 0.5);
}

.rep-resolved-banner {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.5);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rep-resolved-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rep-resolved-meta {
  font-size: 11px;
  font-weight: 700;
  color: #6ee7b7;
}
.rep-resolved-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #ecfdf5;
  font-weight: 600;
}
.rep-admin-reopen-btn {
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}
.rep-admin-resolve-box {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.rep-admin-done-btn,
.adm-rep-resolve-btn {
  padding: 0 12px;
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(52, 211, 153, 0.6);
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.rep-admin-done-btn:disabled,
.adm-rep-resolve-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.rep-all-card.is-resolved {
  border-color: rgba(52, 211, 153, 0.38);
}
.rep-all-resolved-note {
  font-size: 11.5px;
  font-weight: 700;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.14);
  border-radius: 8px;
  padding: 5px 8px;
}

/* Admin Modal Main Tabs (Users | Problem Reports) */
.admin-main-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-main-tab {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.65);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.admin-main-tab.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  color: #f8fafc;
}
.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f59e0b;
  color: #0b1120;
  font-size: 10.5px;
  font-weight: 900;
}
.admin-tab-badge.is-danger {
  background: #ef4444;
  color: #ffffff;
}

/* Admin Problem Reports Manager Pane */
.admin-reports-mount {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adm-rep-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.adm-rep-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.adm-rep-flt {
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.adm-rep-flt.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
}
.adm-rep-flt.active.is-open {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(251, 113, 133, 0.68);
  color: #fecdd3;
}
.adm-rep-flt.active.is-res {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.65);
  color: #a7f3d0;
}
.adm-rep-list {
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.adm-rep-card {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-left: 3px solid #f43f5e;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.adm-rep-card.is-resolved {
  border-left-color: #10b981;
  border-color: rgba(52, 211, 153, 0.3);
}
.adm-rep-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.adm-rep-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.adm-rep-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  word-break: break-word;
  line-height: 1.35;
}
.adm-rep-pid {
  font-size: 10.5px;
  color: #94a3b8;
  word-break: break-all;
}
.adm-rep-card-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.adm-rep-detail-btn {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.adm-rep-sublist {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.adm-rep-subitem {
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(251, 113, 133, 0.24);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.adm-rep-card.is-resolved .adm-rep-subitem {
  border-color: rgba(148, 163, 184, 0.16);
  opacity: 0.85;
}
.adm-rep-subhead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #f8fafc;
}
.adm-rep-subtext {
  font-size: 12px;
  line-height: 1.42;
  color: #e2e8f0;
  word-break: break-word;
}
.adm-rep-resolve-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.adm-rep-note-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(11, 17, 32, 0.9);
  color: #f8fafc;
  font-size: 12px;
}
.adm-rep-done-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.45);
}
.adm-rep-done-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.adm-rep-done-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #a7f3d0;
}
.adm-rep-done-note {
  font-size: 11.5px;
  color: #ecfdf5;
  word-break: break-word;
}
.adm-rep-reopen-btn {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================================
   v93: Admin Live User Activity Monitor & New Updates Aggregator
   ============================================================================ */
.admin-main-tabs.is-3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.admin-main-tabs.is-2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.admin-main-tabs.is-3col .admin-main-tab,
.admin-main-tabs.is-2col .admin-main-tab {
  font-size: 12px;
  padding: 0 6px;
}
.admin-tab-badge.is-info,
.admin-pending-dot.is-info {
  background: #0ea5e9;
  color: #ffffff;
}

.admin-activity-mount {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.adm-mon-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.adm-mon-kpi {
  padding: 8px 9px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-mon-kpi-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: #94a3b8;
}
.adm-mon-kpi-val {
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.2;
}
.adm-mon-kpi-val.is-green { color: #4ade80; }
.adm-mon-kpi-val.is-cyan  { color: #38bdf8; }
.adm-mon-kpi-val.is-amber { color: #fbbf24; }
.adm-mon-kpi-sub {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}
.adm-mon-mark-btn {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.adm-mon-mstrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.adm-mon-mchip {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.adm-mon-mchip.active {
  border-color: rgba(56, 189, 248, 0.78);
  background: rgba(14, 165, 233, 0.18);
}
.adm-mon-mtop {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #f8fafc;
}
.adm-mon-mrank {
  font-size: 9.5px;
  font-weight: 700;
  color: #7dd3fc;
}
.adm-mon-msub {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}
.adm-mon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.adm-mon-dot.is-on {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.85);
}
.adm-mon-dot.is-today { background: #f59e0b; }
.adm-mon-dot.is-off   { background: #475569; }
.adm-mon-mcoach {
  margin-left: 2px;
  border: none;
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 10px;
  cursor: pointer;
}

.adm-mon-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.adm-mon-filters {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.adm-mon-ctrl-right {
  display: flex;
  align-items: center;
  gap: 5px;
}
.adm-mon-live-btn {
  min-height: 34px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.78);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.adm-mon-live-btn.is-live {
  border-color: rgba(34, 197, 94, 0.65);
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.adm-mon-feed {
  max-height: 44vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}
.adm-mon-ev {
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.adm-mon-ev.is-new {
  border-color: rgba(56, 189, 248, 0.58);
  border-left: 3px solid #38bdf8;
  background: rgba(14, 165, 233, 0.1);
}
.adm-mon-ev-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #f8fafc;
}
.adm-mon-type {
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}
.adm-mon-type.t-bookmark { background: rgba(250, 204, 21, 0.22); color: #fde047; }
.adm-mon-type.t-kifu     { background: rgba(168, 85, 247, 0.24); color: #e9d5ff; }
.adm-mon-type.t-report   { background: rgba(244, 63, 94, 0.24); color: #fecdd3; }
.adm-mon-type.t-comment  { background: rgba(14, 165, 233, 0.22); color: #bae6fd; }
.adm-mon-type.t-exam     { background: rgba(16, 185, 129, 0.22); color: #a7f3d0; }
.adm-mon-type.t-signup   { background: rgba(249, 115, 22, 0.24); color: #fed7aa; }
.adm-mon-type.t-login    { background: rgba(100, 116, 139, 0.28); color: #cbd5e1; }
.adm-mon-new-pill {
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 999px;
  background: #38bdf8;
  color: #0b1120;
  letter-spacing: 0.03em;
}
.adm-mon-ev-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.adm-mon-ev-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.adm-mon-ev-title {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  word-break: break-word;
  line-height: 1.35;
}
.adm-mon-ev-detail {
  font-size: 11.5px;
  color: #cbd5e1;
  word-break: break-word;
  line-height: 1.4;
}
.adm-mon-ev-acts {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.adm-mon-act-btn {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.adm-mon-act-btn.is-primary {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.2);
  color: #bae6fd;
}
.adm-mon-act-btn.is-warn {
  border-color: rgba(251, 113, 133, 0.52);
  background: rgba(244, 63, 94, 0.18);
  color: #fecdd3;
}

/* ============================================================================
   v94: Comment Spoiler Guard Curtain (Auto-unlocks on Right/Wrong/Solution)
   ============================================================================ */
.dock-cmt-mini.is-guard-on {
  border-color: rgba(250, 204, 21, 0.5);
  background: rgba(234, 179, 8, 0.16);
  color: #fde047;
}
.dock-cmt-body-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
}
.dock-cmt-body-wrap.is-spoiler-masked .dock-cmt-list {
  filter: blur(7px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  transition: filter 0.22s ease, opacity 0.22s ease;
}
.spoiler-curtain {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  text-align: center;
  background: rgba(11, 17, 32, 0.62);
  backdrop-filter: blur(2px);
  border: 1px dashed rgba(148, 163, 184, 0.34);
  border-radius: 10px;
}
.spoiler-curtain-icon {
  font-size: 22px;
  line-height: 1;
}
.spoiler-curtain-title {
  font-size: 12.5px;
  font-weight: 900;
  color: #f8fafc;
}
.spoiler-curtain-sub {
  font-size: 11px;
  line-height: 1.45;
  color: #cbd5e1;
}
.spoiler-peek-btn {
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.58);
  background: rgba(14, 165, 233, 0.24);
  color: #e0f2fe;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.spoiler-peek-btn:hover {
  background: rgba(14, 165, 233, 0.36);
}
.spoiler-peek-btn.is-sm {
  margin-top: 0;
  padding: 4px 10px;
  font-size: 11px;
  flex-shrink: 0;
}

.rep-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rep-guard-toggle {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.78);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}
.rep-guard-toggle.is-on {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(234, 179, 8, 0.18);
  color: #fde047;
}
.rep-spoiler-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px dashed rgba(250, 204, 21, 0.45);
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
}

/* ============================================================================
   v98: Dojo Friends Live Online Presence Strip & Badges
   ============================================================================ */
.dojo-online-strip {
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}
.dojo-online-strip.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.86));
}
.dojo-online-strip.is-quiet {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 9px 12px;
}
.dojo-online-strip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #a7f3d0;
}
.dojo-online-strip-lbl {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
}
.dojo-online-strip-sub {
  font-size: 11px;
  color: #94a3b8;
}
.dojo-online-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dojo-online-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.42);
  font-size: 11.5px;
  color: #ecfdf5;
}
.dojo-online-act {
  font-size: 10.5px;
  color: #6ee7b7;
  font-weight: 700;
}

.dojo-pres-dot {
  display: inline-block;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dojo-pres-dot.is-online {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: ggOnlinePulse 2s ease-out infinite;
}
.dojo-pres-dot.is-recent {
  background: #f59e0b;
}
.dojo-pres-dot.is-offline {
  background: #64748b;
}
@keyframes ggOnlinePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.dojo-pres-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.dojo-pres-pill.is-online {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.52);
  color: #a7f3d0;
}
.dojo-pres-pill.is-recent {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fde68a;
}
.dojo-pres-pill.is-offline {
  background: rgba(51, 65, 85, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #94a3b8;
}

.dojo-friend-card.is-online-card {
  border-color: rgba(52, 211, 153, 0.48);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.12);
}

/* ============================================================================
   v99: iPhone Safe-Area Header Sharpness, iPad Full-Width & Zero-Clip Layout,
        Universal SVG Close Icons, Auth Boot Guard & Rank Exam Quit Confirm
   ============================================================================ */

/* Keep mobile small-screen header top safe-area intact */
@media (max-width: 440px) {
  .top-header {
    padding: calc(6px + var(--safe-top)) 8px 6px !important;
  }
}

/* Safe bottom padding moved inside nav-tab on mobile so no empty gap appears below bottom-nav */
@media (max-width: 1023px) {
  .bottom-nav {
    padding-bottom: 0 !important;
  }
  .bottom-nav .nav-tab {
    min-height: 46px;
    padding: 5px 1px calc(6px + var(--safe-bottom) * 0.55);
  }
}

/* iPad / Tablet Portrait (681px ~ 1023px): Full-width edge-to-edge + zero clipped bottom controls */
@media (min-width: 681px) and (max-width: 1023px) {
  .app-shell {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    height: 100%;
    height: 100dvh;
  }
  .top-header {
    padding: calc(8px + var(--safe-top)) 16px 8px;
  }
  #viewPlay.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  #viewPlay.active .board-stage {
    flex: 1 1 0;
    min-height: 0;
    padding: 8px 14px;
  }
  #viewPlay.active .action-bar {
    flex-shrink: 0;
    padding: 8px 14px;
    gap: 8px;
  }
  #viewPlay.active .act-btn {
    min-height: 46px;
    font-size: 13px;
  }
  .view-scroll > * {
    max-width: 860px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Desktop & iPad Landscape (>= 1024px): dvh height + safe-area header + fit-in-viewport deck */
@media (min-width: 1024px) {
  .app-shell {
    height: 100vh;
    height: 100dvh;
    grid-template-rows: calc(54px + var(--safe-top)) minmax(0, 1fr);
  }
  .top-header,
  .app-header {
    height: calc(54px + var(--safe-top));
    padding: var(--safe-top) 22px 0;
  }
  #viewPlay.active {
    padding: 12px 18px;
    column-gap: 16px;
    row-gap: 10px;
  }
  #viewKifu.active {
    grid-template-columns: minmax(340px, min(calc(100dvh - 86px - var(--safe-top)), calc(100vw - 495px))) minmax(320px, 380px);
  }
  #viewKifu.active .board-stage,
  #viewKifu.active .kifu-board-stage {
    height: calc(100dvh - 86px - var(--safe-top));
  }
}

@media (min-width: 1024px) and (max-width: 1399px) {
  #viewPlay.active {
    grid-template-columns: minmax(340px, min(calc(100dvh - 86px - var(--safe-top)), calc(100vw - 455px))) minmax(290px, 340px);
  }
}

/* iPad Landscape / Short-height wide viewports (e.g., 1024x768, 1180x820, 1194x834) */
@media (min-width: 1024px) and (max-height: 860px) {
  #viewPlay.active {
    padding: 10px 16px;
    row-gap: 8px;
  }
  #viewPlay.active .play-meta-bar {
    padding: 8px 10px !important;
  }
  #viewPlay.active .status-banner {
    padding: 8px 10px !important;
    font-size: 12.5px;
  }
  #viewPlay.active .action-bar {
    padding: 8px !important;
    gap: 6px !important;
  }
  #viewPlay.active .act-btn {
    min-height: 40px !important;
    font-size: 12px !important;
  }
  #viewPlay.active .info-footer {
    padding: 10px 12px;
    max-height: 140px;
    gap: 5px;
  }
  #viewPlay.active .desktop-streak-banner {
    padding: 10px 14px;
    border-radius: 18px;
  }
  #viewPlay.active .desktop-streak-main {
    font-size: 24px;
  }
  #viewPlay.active .desktop-shortcut-card {
    display: none !important;
  }
}

/* Universal crisp SVG close icon (prevents font-missing □/▯ glyph on Windows/iOS/Android) */
.ico-close-svg {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  pointer-events: none;
}
.btn-aim-cancel .ico-close-svg,
.kifu-aim-cancel .ico-close-svg {
  width: 15px;
  height: 15px;
}
.rep-del-btn .ico-close-svg,
.col-cur-multi-del .ico-close-svg,
.saved-account-del .ico-close-svg {
  width: 11px;
  height: 11px;
}

/* Settings subtle hint below Touch Mode row */
.s-sub-hint {
  margin: -4px 0 6px;
  padding: 0 2px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* Initial Auth Boot & Login Gate Guard (prevents background flash & post-login click-through) */
html.auth-booting .app-shell {
  opacity: 0;
  pointer-events: none;
}
html.auth-gate-open .app-shell {
  pointer-events: none;
}
.auth-gate-overlay {
  background: radial-gradient(circle at top, #172a5e 0%, #0f172a 70%, #090e1a 100%) !important;
}

/* Rank Exam Quit Confirmation Overlay inside #rankExamModal */
.rank-exam-card {
  position: relative;
}
.exam-quit-confirm {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(9, 13, 24, 0.84);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: inherit;
}
.exam-quit-confirm.hidden {
  display: none !important;
}
.exam-quit-box {
  width: 100%;
  max-width: 340px;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 18px;
  padding: 20px 18px 16px;
  text-align: center;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65);
}
.exam-quit-ico {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}
.exam-quit-title {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  margin: 0 0 6px;
}
.exam-quit-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0 0 16px;
}
.exam-quit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-quit-actions .btn-safe-primary {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
}
.exam-quit-actions .btn-quit-danger {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.exam-quit-actions .btn-quit-danger:hover {
  background: rgba(185, 28, 28, 0.5);
}

/* v100: 50-Question Rank Exam Compact 10x5 Progress Grid & Scrollable Result Review Grid */
.exam-dots {
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 3px !important;
  margin-bottom: 6px !important;
}
.exam-dot {
  height: 18px !important;
  border-radius: 4px !important;
  font-size: 9.5px !important;
}
.exam-res-grid {
  max-height: 245px;
  overflow-y: auto;
  padding-right: 2px;
}

/* v101: Settings App Bug Report Button & Admin Unified Reports Switch */
.s-bug-report-btn {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.42);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.36), rgba(30, 41, 59, 0.85));
  color: #fecaca;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.s-bug-report-btn:hover {
  border-color: rgba(248, 113, 113, 0.72);
}
.s-bug-report-btn:active {
  transform: scale(0.98);
}
.s-bug-main {
  font-size: 13px;
  font-weight: 800;
  color: #fef2f2;
}
.s-bug-sub {
  font-size: 11px;
  color: #fca5a5;
  opacity: 0.9;
}

.adm-rep-kind-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.adm-rep-kind-btn {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.adm-rep-kind-btn.active {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}
.adm-bug-device {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 3px;
  font-family: ui-monospace, Consolas, monospace;
}
.app-bug-device-pill {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 6px 9px;
  margin: 6px 0 8px;
  line-height: 1.35;
}

/* ============================================================================
   Kifu Vertical Space Optimization:
   1) AI Compact 1-Line Collapse Toggle
   2) Foldable / Tablet 2-Column Layout (720px~1023px)
   3) Kifu Board Focus Mode (Hide Header, Nav & Secondary Controls)
   ============================================================================ */
.kifu-mode-chip.kifu-focus-chip {
  flex: 0 0 auto;
  padding: 0 9px;
}
.kifu-mode-chip.active-focus {
  background: rgba(14, 165, 233, 0.25);
  border-color: rgba(56, 189, 248, 0.85);
  color: #bae6fd;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.kifu-active-banner.mode-ai.is-collapsed {
  padding: 4px 8px;
}
.ai-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.ai-compact-summary-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 2px 0;
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.ai-compact-icon {
  flex-shrink: 0;
}
.ai-compact-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Focus Mode */
body.kifu-focus-mode .top-header,
body.kifu-focus-mode .app-header,
body.kifu-focus-mode .bottom-nav {
  display: none !important;
}
body.kifu-focus-mode .app-shell {
  grid-template-rows: minmax(0, 1fr) !important;
  padding-top: var(--safe-top);
}
#viewKifu.is-focus-mode .kifu-meta-bar,
#viewKifu.is-focus-mode .kifu-coach-banner,
#viewKifu.is-focus-mode #kifuCommentRow,
#viewKifu.is-focus-mode .kifu-dock-row-2 {
  display: none !important;
}
#viewKifu.is-focus-mode .kifu-mode-strip {
  padding: 3px 6px;
  gap: 4px;
}
#viewKifu.is-focus-mode .kifu-mode-chip {
  height: 26px;
  font-size: 11px;
}
#viewKifu.is-focus-mode .kifu-controls-deck {
  padding: 4px 6px calc(4px + var(--safe-bottom));
  gap: 4px;
}
#viewKifu.is-focus-mode .kifu-controls-deck .kifu-nav-btn,
#viewKifu.is-focus-mode .kifu-controls-deck .kifu-tool-btn {
  height: 38px;
  min-height: 38px;
}

/* Foldable / Tablet 2-Column Kifu Studio (720px ~ 1023px, square or landscape) */
@media (min-width: 720px) and (max-width: 1023px) and (min-aspect-ratio: 4/5) {
  #viewKifu.active {
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) minmax(265px, 320px);
    grid-template-rows: none;
    grid-auto-rows: max-content;
    align-content: start;
    column-gap: 12px;
    row-gap: 6px;
    width: 100%;
    height: 100%;
    padding: 8px 12px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
  }
  #viewKifu.active .board-stage,
  #viewKifu.active .kifu-board-stage {
    grid-column: 1;
    grid-row: 1 / span 10;
    width: 100%;
    height: calc(100dvh - 126px - var(--safe-top));
    min-width: 0;
    min-height: 260px;
    padding: 8px;
    border-radius: 14px;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.35));
    border: 1px solid rgba(148, 163, 184, 0.18);
  }
  body.kifu-focus-mode #viewKifu.active .board-stage,
  body.kifu-focus-mode #viewKifu.active .kifu-board-stage {
    height: calc(100dvh - 20px - var(--safe-top));
  }
  #viewKifu.active > :not(.board-stage):not(.kifu-board-stage) {
    grid-column: 2;
    align-self: start;
    height: auto !important;
    min-width: 0;
  }
  #viewKifu.active .kifu-meta-bar {
    border-radius: 10px;
    padding: 7px 10px !important;
  }
  #viewKifu.active .kifu-mode-strip {
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
  }
  #viewKifu.active .kifu-mode-chip {
    height: 28px;
    font-size: 11px;
    padding: 0 4px;
  }
  #viewKifu.active .kifu-active-banner {
    border-radius: 10px;
  }
  #viewKifu.active .kifu-controls-deck {
    border-radius: 10px;
    padding: 6px;
    gap: 4px;
  }
  #viewKifu.active .kifu-controls-deck .kifu-nav-btn,
  #viewKifu.active .kifu-controls-deck .kifu-tool-btn,
  #viewKifu.active .kifu-controls-deck .kifu-act-btn {
    height: 38px;
    min-height: 38px;
    font-size: 10px;
  }
  #viewKifu.active .kifu-controls-deck svg {
    width: 15px;
    height: 15px;
  }
}

/* Narrow phones (<= 440px): Fit all 5 kifu mode chips including Focus chip cleanly */
@media (max-width: 440px) {
  .kifu-mode-strip {
    padding: 4px 6px 3px;
    gap: 3px;
  }
  .kifu-mode-chip {
    padding: 0 4px;
    font-size: 10.5px;
  }
  .kifu-mode-chip.kifu-focus-chip {
    padding: 0 6px;
  }
}

/* iOS Standalone PWA (iOS 26+): Solid fixed top header prevents WebKit progressive scroll-edge blur */
@media (max-width: 1023px) {
  html.ios-standalone .top-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: calc(50px + var(--safe-top));
    padding: var(--safe-top) 10px 0 !important;
    background-image: none !important;
  }
  html.ios-standalone .main-content {
    margin-top: calc(50px + var(--safe-top));
  }
  html.ios-standalone body.kifu-focus-mode .main-content {
    margin-top: 0;
  }
  /* Hide floating 2-tap aim confirmation pill on mobile/tablet */
  .aim-bar,
  .kifu-aim-pill {
    display: none !important;
  }
}

/* ============================================================================
   Phase 2: Simplified Collections Mastery & Admin Dojo Management / Homework
   ============================================================================ */
.col-cur-head-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  flex: 1;
}
.col-cur-multi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0;
}
.col-cur-multi-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  overflow: hidden;
  max-width: 100%;
}
.col-cur-multi-chip.is-here {
  border-color: rgba(250, 204, 21, 0.65);
  background: rgba(250, 204, 21, 0.14);
}
.col-cur-chip-btn {
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.col-cur-chip-del {
  border: none;
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 7px;
  cursor: pointer;
}
.folder-prof-pct {
  font-size: 11.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.folder-prof-pct.st-new { color: #94a3b8; }
.folder-prof-pct.st-learning { color: #38bdf8; }
.folder-prof-pct.st-ready { color: #34d399; }
.folder-prof-pct.st-mastered { color: #facc15; }

/* Dojo Admin Mode & Homework Cards */
.dojo-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.85));
}
.dojo-admin-top-title {
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dojo-admin-top-sub {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 3px;
}
.dojo-admin-top-acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dojo-admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .dojo-admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.dojo-admin-kpi {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dojo-admin-kpi.k-act {
  align-items: center;
}
.dojo-admin-kpi .k-lbl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.dojo-admin-kpi .k-val {
  font-size: 19px;
  font-weight: 900;
  margin: 2px 0;
}
.dojo-admin-kpi .k-sub {
  font-size: 11px;
  color: var(--muted);
}
.dojo-admin-hw-form-card,
.dojo-hw-card {
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  padding: 12px 14px;
}
.dojo-hw-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .dojo-hw-form-grid {
    grid-template-columns: 1fr;
  }
}
.dojo-hw-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dojo-hw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
}
.dojo-hw-field-full {
  grid-column: 1 / -1;
}
.dojo-fp-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dojo-fp-trigger-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dojo-fp-trigger {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}
.dojo-fp-trigger.is-open {
  border-color: rgba(56, 189, 248, 0.65);
}
.dojo-fp-trigger-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dojo-fp-caret {
  flex-shrink: 0;
  opacity: 0.75;
}
.dojo-fp-clear {
  min-width: 38px;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.dojo-fp-panel {
  border-radius: 11px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: rgba(15, 23, 42, 0.94);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dojo-fp-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dojo-fp-search {
  flex: 1 1 180px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  font-size: 12px;
}
.dojo-fp-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}
.dojo-fp-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 2px 4px;
}
.dojo-fp-row.depth-2 { padding-left: 18px; }
.dojo-fp-row.depth-3 { padding-left: 34px; }
.dojo-fp-row.depth-4 { padding-left: 48px; }
.dojo-fp-row:hover {
  background: rgba(56, 189, 248, 0.12);
}
.dojo-fp-row.is-selected {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.dojo-fp-exp {
  width: 28px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}
.dojo-fp-branch {
  width: 22px;
  text-align: center;
  color: #64748b;
  font-size: 11px;
  flex-shrink: 0;
}
.dojo-fp-pick {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 4px 6px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}
.dojo-fp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dojo-fp-cnt {
  flex-shrink: 0;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-weight: 800;
}
.dojo-fp-empty {
  padding: 14px 8px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}
.dojo-hw-field input,
.dojo-hw-field select {
  min-height: 36px;
  border-radius: 9px;
  padding: 0 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
}
.dojo-hw-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.dojo-hw-list,
.dojo-admin-members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dojo-hw-item,
.dojo-admin-member-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dojo-hw-item.is-done {
  border-color: rgba(16, 185, 129, 0.48);
  background: rgba(16, 185, 129, 0.08);
}
.dojo-hw-head,
.dojo-admin-m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.dojo-hw-title-wrap,
.dojo-admin-m-id,
.dojo-admin-m-acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.dojo-hw-title {
  font-size: 13px;
  font-weight: 800;
}
.dojo-hw-folder-tag,
.dojo-hw-pending-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}
.dojo-hw-due {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.dojo-hw-note {
  font-size: 11.5px;
  color: #fde047;
}
.dojo-hw-prog-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dojo-hw-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.dojo-hw-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 999px;
}
.dojo-hw-fill.is-done {
  background: linear-gradient(90deg, #059669, #34d399);
}
.dojo-hw-nums {
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dojo-hw-acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dojo-admin-m-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 11.5px;
  color: #cbd5e1;
}
.dojo-admin-hw-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dojo-admin-hw-empty {
  font-size: 11px;
  color: var(--muted);
}
.dojo-admin-hw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 11.5px;
}
.dojo-admin-hw-row.is-done {
  border-color: rgba(16, 185, 129, 0.45);
}
.ahw-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.ahw-title { font-weight: 800; }
.ahw-prog { opacity: 0.85; font-variant-numeric: tabular-nums; }
.ahw-btns { display: flex; gap: 4px; flex-shrink: 0; }
.dojo-mini-btn.is-danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

/* Changelog & Manual UI */
.s-quick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.s-mini-btn {
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.72);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 10px;
}
.s-mini-btn:hover {
  border-color: rgba(56, 189, 248, 0.65);
}
.changelog-modal-card {
  max-width: 560px;
  width: min(560px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.cl-current-ver {
  margin: 8px 0 10px;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
}
.cl-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  padding-right: 2px;
}
.upd-changelog-box {
  max-height: 210px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upd-cl-cap {
  font-size: 11.5px;
  font-weight: 900;
  color: #fde047;
}
.cl-entry {
  border-radius: 10px;
  padding: 9px 11px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.cl-entry.is-current {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.12);
}
.cl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.cl-ver {
  font-size: 12px;
  font-weight: 900;
  color: #38bdf8;
}
.cl-entry.is-current .cl-ver {
  color: #6ee7b7;
}
.cl-date {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}
.cl-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 5px;
}
.cl-list {
  margin: 0;
  padding-left: 17px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.5;
}
.cl-list li {
  margin-bottom: 3px;
}
.cl-empty {
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}
