/* =========================================================
   CHESS MASTERCLASS — SHARED APP STYLESHEET
   Layout + mobile frame extracted from index.html so every
   sub-page matches the app design exactly.
   Theme palettes live in shared/theme.css (single source).
   ========================================================= */

/* =========================================================
   LAYOUT & MOBILE APP FRAME
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

body {
  background-color: #05070a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
}

.app-screen {
  width: 100%;
  max-width: 412px;
  min-height: 100vh;
  background: var(--app-gradient);
  padding: 2.5rem 1.4rem 6rem;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

@media (min-width: 480px) {
  .app-screen {
    min-height: 870px;
    height: 870px;
    border-radius: 40px;
    border: 1px solid var(--border);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .app-screen::-webkit-scrollbar { display: none; }
}

/* Top Greeting Bar */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}

.greeting-text, .page-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: 1.45rem;
  flex: 1;
}

.theme-badge {
  background: var(--surface-circle);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.back-btn {
  background: var(--surface-circle);
  border: 1px solid var(--border-bright);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 0.6rem;
}

.back-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

/* =========================================================
   SECTION LABEL + COURSE CARDS
   ========================================================= */
.section-label {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.courses-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

/* =========================================================
   GENERAL UI HELPERS
   ========================================================= */
.btn {
  background: var(--btn-action-bg);
  color: var(--btn-action-color);
  border: none;
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--btn-action-shadow);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  flex-shrink: 0;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn.ghost {
  background: var(--surface-circle);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-bright);
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.pill {
  background: var(--surface-circle);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pill svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Row list item (generic link card) */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: var(--surface-circle);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.95rem 1.05rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.7rem;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.row:active {
  transform: scale(0.985);
}

.row-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.row-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

.row-num {
  background: var(--btn-action-bg);
  color: var(--btn-action-color);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.72rem;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--btn-action-shadow);
}

.row-num.done {
  background: #2ecc71;
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
}

.row-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

.row-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Search input */
.search-group {
  margin-bottom: 1rem;
}

.search-group input {
  width: 100%;
  background: var(--surface-circle);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-group input::placeholder {
  color: var(--text-muted);
}

/* Section divider inside content lists */
.sec-block {
  margin-bottom: 1.4rem;
}

.sec-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sec-label .count {
  background: var(--surface-circle);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tags-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.2rem 0.55rem;
  font-family: 'JetBrains Mono', monospace;
}

.done-badge {
  color: #2ecc71 !important;
  border-color: rgba(46, 204, 113, 0.45);
  background: rgba(46, 204, 113, 0.12);
}

.course-card {
  border-radius: 20px;
  padding: 1.25rem 1.4rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.15s ease;
  min-height: 82px;
}

.course-card:hover {
  transform: translateY(-2px);
}

.course-card.card-purple {
  background: var(--card-1);
}

.course-card.card-teal {
  background: var(--card-2);
}

.course-card.card-hero {
  background: var(--card-hero);
}

.course-card-content {
  z-index: 2;
  position: relative;
  max-width: 220px;
}

.course-card-content.wide {
  max-width: 100%;
}

.course-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.course-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-arrow {
  z-index: 2;
  position: relative;
  transition: transform 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.course-card:hover .card-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.card-arrow svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}