﻿:root {
  color-scheme: light;
  --bg: #f2f4f7;
  --panel: #fbfcfe;
  --panel-2: #eef2f6;
  --cell: #fbfcfe;
  --ink: #000000;
  --muted: #111111;
  --line: rgba(0, 0, 0, 0.28);
  --red: #dc2742;
  --teal: #087f7a;
  --gold: #5c3b00;
  --blue: #1d4ed8;
  --focus: #000000;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0d0f14;
}

.lock-box {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 34, 0.96);
  box-shadow: var(--shadow);
}

.lock-box strong {
  font-size: 1.35rem;
}

.lock-box label,
.form-grid label,
.control-card {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.lock-box input,
.form-grid input,
.form-grid select,
.control-card select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #10131a;
  color: var(--ink);
  font-weight: 850;
}

.lock-message {
  min-height: 20px;
  margin: 0;
  color: var(--gold);
  font-size: 0.86rem;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.topbar,
.preview-head,
.panel-head,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar h1,
.preview-head h2,
.panel-head h2,
.result-head h2 {
  margin: 0;
  line-height: 1.08;
}

.topbar h1 {
  font-size: clamp(1.45rem, 2.2vw, 2.4rem);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.73rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-line {
  max-width: 520px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 181, 68, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(245, 181, 68, 0.08);
  color: #f7d994;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.ranking-actions {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.ranking-league-tabs {
  flex: 0 0 390px;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ranking-filter-divider {
  flex: 0 0 1px;
  height: 40px;
  align-self: center;
  background: rgba(15, 23, 42, 0.22);
}

.ranking-player-tabs {
  flex: 0 0 208px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ranking-league-tab,
.ranking-player-tab {
  width: 100%;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12151b;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 950;
}

.ranking-league-tab.is-active,
.ranking-player-tab.is-active {
  border-color: rgba(8, 127, 122, 0.78);
  background: rgba(53, 184, 176, 0.16);
  color: var(--ink);
}

.ranking-settings {
  flex: 0 0 88px;
  display: grid;
  grid-template-columns: 88px;
  gap: 8px;
  margin: 0 0 0 auto;
}

.ranking-settings label {
  display: grid;
  grid-template-rows: 16px 1fr;
  align-items: center;
  height: 56px;
  margin: 0;
  padding: 6px 10px 7px;
  border: 1px solid rgba(0, 0, 0, 0.34);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
}

.ranking-settings input {
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #000000;
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1;
  appearance: textfield;
}

.ranking-settings input::-webkit-outer-spin-button,
.ranking-settings input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.ranking-status-line {
  width: min(320px, 100%);
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 181, 68, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(245, 181, 68, 0.08);
  color: #f7d994;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.ranking-topline {
  display: grid;
  align-items: center;
  gap: 8px;
}

.ranking-category-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 2px 0 0;
}

.ranking-category-group {
  display: grid;
  gap: 8px;
}

.ranking-category-group h3 {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 950;
}

.ranking-category-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ranking-category-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #12151b;
  color: #d8e5f5;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: left;
}

.ranking-category-button.is-active {
  border-color: rgba(245, 181, 68, 0.8);
  background: rgba(245, 181, 68, 0.14);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(245, 181, 68, 0.22);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 430px 260px;
  align-items: start;
  gap: 18px;
}

.source-panel,
.control-panel {
  display: grid;
  gap: 14px;
}

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

.mode-tab,
.period-tab,
.country-tab {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12151b;
  color: var(--muted);
  cursor: pointer;
  font-weight: 950;
}

.mode-tab.is-active,
.period-tab.is-active,
.country-tab.is-active {
  border-color: rgba(53, 184, 176, 0.8);
  background: rgba(53, 184, 176, 0.16);
  color: var(--ink);
}

.national-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.72fr);
  gap: 8px;
}

.country-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 8px;
}

.period-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  gap: 8px;
}

.period-tab,
.country-tab {
  min-height: 42px;
  padding: 0 12px;
}

.mode-panel,
.result-panel,
.control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(24, 27, 34, 0.82);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ranking-actions .primary-button {
  flex: 0 0 172px;
  width: 172px;
  height: 56px;
  min-height: 56px;
  margin: 0;
}

.ranking-progress {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ranking-progress[hidden] {
  display: none;
}

.ranking-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.ranking-progress-top strong {
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 950;
}

.ranking-progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(53, 184, 176, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.ranking-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 420ms ease;
}

.korea-results-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 0;
}

.korea-calendar-column {
  display: grid;
  gap: 12px;
}

.korea-calendar-column .period-tabs {
  width: 100%;
  min-width: 0;
}

.korea-calendar-column .calendar-box {
  margin-top: 0;
}

.korea-inline-list {
  display: grid;
  gap: 14px;
  overflow: visible;
  min-height: 250px;
}

.korea-player-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.korea-player-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.korea-player-row strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.25;
}

.korea-player-row > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.35;
}

.korea-player-row .korea-profile-line {
  color: #cbd8e8;
  font-size: 0.76rem;
  font-weight: 800;
}

.korea-player-row p {
  margin: 0;
  color: var(--teal);
  font-size: 0.98rem;
  font-weight: 950;
  line-height: 1.35;
}

.korea-stat-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.korea-stat-group {
  min-width: 0;
}

.korea-stat-group b,
.korea-stat-group span,
.korea-stat-group em {
  display: block;
  line-height: 1.35;
}

.korea-stat-group b {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
}

.korea-stat-group span {
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.korea-stat-group em {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.korea-empty {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.korea-empty strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.korea-loading {
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.korea-loading strong {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 950;
}

.korea-loading em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.korea-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.korea-load-error {
  min-height: 250px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

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

.calendar-box {
  margin-top: 14px;
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(18, 21, 27, 0.82);
}

.calendar-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

#koreaPanel .calendar-head .icon-button {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.calendar-head strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
  text-align: center;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 950;
  text-align: center;
}

.calendar-day {
  aspect-ratio: 1;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 5px;
  background: #10131a;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 900;
}

.calendar-day.is-muted {
  color: rgba(183, 192, 204, 0.45);
}

.calendar-day.is-today {
  border-color: rgba(245, 181, 68, 0.65);
}

.calendar-day.is-selected {
  border-color: rgba(53, 184, 176, 0.95);
  background: rgba(53, 184, 176, 0.22);
  color: #ffffff;
}

.result-panel {
  min-height: 360px;
}

.ranking-result-panel {
  margin-top: 14px;
}

.result-head {
  margin-bottom: 12px;
}

#resultMeta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.result-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 360px);
  min-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.result-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--cell);
}

.result-rank {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(245, 181, 68, 0.15);
  color: var(--gold);
  font-weight: 950;
}

.result-main {
  min-width: 0;
}

.result-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-main span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-main .result-profile-line {
  margin-top: 2px;
  color: #000000;
  font-size: 0.72rem;
  font-weight: 950;
}

.result-value {
  min-width: 84px;
  color: var(--teal);
  font-size: 0.98rem;
  font-weight: 950;
  text-align: right;
}

.result-detail-blocks {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.result-detail {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.045);
}

.result-detail b,
.result-detail span,
.result-detail em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-detail b {
  color: var(--gold);
  font-size: 0.68rem;
}

.result-detail span {
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.result-detail em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.preview-panel {
  display: grid;
  gap: 12px;
}

.canvas-frame {
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
}

.canvas-stack {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 9 / 16;
}

.canvas-stack canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #06080c;
  box-shadow: none;
}

.canvas-play-zone {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 172px;
  height: 172px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}

.canvas-play-button {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.72);
  color: #fffaf0;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.88);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.canvas-play-zone:hover .canvas-play-button,
.canvas-play-zone:focus-within .canvas-play-button {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.canvas-seek-zone {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
}

.canvas-seek {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.canvas-seek-zone:hover .canvas-seek,
.canvas-seek-zone:focus-within .canvas-seek,
.canvas-seek.is-seeking {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.canvas-seek input[type="range"] {
  min-width: 0;
  width: 100%;
  accent-color: #f3b33d;
  cursor: pointer;
}

.canvas-seek span {
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.control-panel {
  gap: 12px;
}

.control-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-2);
}

.control-card span {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  align-items: center;
}

.control-card strong {
  color: var(--ink);
}

.control-card em {
  color: #cbd8e8;
  font-style: normal;
  font-size: 0.76rem;
}

.control-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

.button-stack {
  display: grid;
  gap: 10px;
}

.primary-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 950;
}

.primary-button {
  min-height: 48px;
  padding: 0 16px;
  background: #fff7ed;
  color: #081013;
}

.primary-button.accent {
  background: var(--red);
  color: #fff;
}

.primary-button:disabled,
.icon-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #232834;
  color: var(--ink);
}

/* Light readability theme */
.lock-screen,
.app-shell {
  background: #f2f4f7;
}

.lock-box,
.mode-panel,
.result-panel,
.control-panel,
.control-card,
.calendar-box,
.result-card {
  background: #fbfcfe;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.lock-box input,
.form-grid input,
.form-grid select,
.control-card select,
.mode-tab,
.period-tab,
.country-tab,
.ranking-league-tab,
.ranking-player-tab,
.ranking-category-button,
.calendar-day,
.icon-button {
  border-color: rgba(15, 23, 42, 0.22);
  background: #ffffff;
  color: var(--ink);
}

.status-line,
.ranking-status-line {
  border-color: rgba(154, 101, 0, 0.35);
  background: #fff8e1;
  color: #0b0f14;
}

.mode-tab.is-active,
.period-tab.is-active,
.country-tab.is-active,
.ranking-league-tab.is-active,
.ranking-player-tab.is-active {
  border-color: rgba(8, 127, 122, 0.78);
  background: #e6fffb;
  color: #0b0f14;
}

.ranking-category-button.is-active {
  border-color: rgba(154, 101, 0, 0.78);
  background: #fff1bf;
  color: #0b0f14;
  box-shadow: inset 0 0 0 1px rgba(154, 101, 0, 0.18);
}

.ranking-progress-track {
  border-color: rgba(8, 127, 122, 0.34);
  background: #e8edf3;
}

.korea-player-row {
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

.korea-player-row .korea-profile-line,
.control-card em {
  color: #334155;
}

.korea-spinner {
  border-color: rgba(15, 23, 42, 0.14);
  border-top-color: var(--teal);
}

.calendar-day {
  border-color: rgba(15, 23, 42, 0.16);
}

.calendar-day.is-muted {
  color: rgba(63, 74, 90, 0.52);
}

.calendar-day.is-today {
  border-color: rgba(154, 101, 0, 0.74);
}

.calendar-day.is-selected {
  border-color: rgba(8, 127, 122, 0.95);
  background: #d7fffb;
  color: #0b0f14;
}

.result-rank {
  background: #fff1bf;
  color: #0b0f14;
}

.result-detail {
  border-color: rgba(15, 23, 42, 0.14);
  background: #f3f5f8;
}

.canvas-stack canvas {
  border-color: rgba(15, 23, 42, 0.18);
  border: 1px solid var(--line);
  background: #f5f6f8;
}

.canvas-play-button,
.canvas-seek {
  border-color: rgba(15, 23, 42, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: #0b0f14;
}

.canvas-seek span {
  color: #0b0f14;
}

.primary-button {
  border: 1px solid rgba(15, 23, 42, 0.82);
  background: #ffffff;
  color: #0b0f14;
}

.primary-button.accent {
  border-color: rgba(220, 39, 66, 0.7);
  background: #ffe5ea;
  color: #0b0f14;
}

.app-shell,
.app-shell button,
.app-shell input,
.app-shell select,
.app-shell label,
.app-shell strong,
.app-shell span,
.app-shell p,
.app-shell b,
.app-shell em,
.lock-screen,
.lock-screen button,
.lock-screen input,
.lock-screen label {
  color: #000000;
  text-shadow: none;
}

.mode-tab,
.period-tab,
.country-tab,
.ranking-league-tab,
.ranking-player-tab,
.ranking-category-button,
.primary-button,
.icon-button,
.form-grid input,
.form-grid select,
.control-card select,
.lock-box input {
  border-color: rgba(0, 0, 0, 0.34);
  color: #000000;
  font-weight: 950;
}

.ranking-category-group h3,
.eyebrow,
.korea-stat-group b,
.result-detail b {
  color: #3b2500;
  font-weight: 950;
}

.form-grid label,
.control-card,
.status-line,
.ranking-status-line,
.ranking-progress-top,
.korea-player-row > span,
.korea-player-row .korea-profile-line,
.korea-stat-group em,
.korea-empty,
.korea-loading,
.korea-loading em,
.calendar-weekdays,
#resultMeta,
.result-main span,
.result-detail em,
.control-card em,
.canvas-seek span {
  color: #000000;
  font-weight: 950;
}

.result-main strong,
.korea-player-row strong,
.korea-stat-group span,
.result-detail span,
.control-card strong {
  color: #000000;
  font-weight: 950;
}

.calendar-day.is-muted {
  color: rgba(0, 0, 0, 0.48);
}

/* Sharp text/canvas override: 20260518 clarity pass */
html,
body,
button,
input,
textarea,
select {
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
}

body,
.app-shell,
.source-panel,
.preview-panel,
.control-panel,
.result-panel,
.lock-screen {
  transform: none;
  filter: none;
  text-shadow: none;
}

.app-shell :where(button, input, textarea, select, label, span, p, em),
.source-panel :where(button, input, textarea, select, label, span, p, em),
.preview-panel :where(button, input, textarea, select, label, span, p, em),
.control-panel :where(button, input, textarea, select, label, span, p, em),
.result-panel :where(button, input, textarea, select, label, span, p, em) {
  font-weight: 400;
  letter-spacing: 0;
  text-shadow: none;
  filter: none;
}

.app-shell :where(strong, h1, h2, h3, .mode-tab, .country-tab, .period-tab, .ranking-league-tab, .ranking-player-tab, .ranking-category-group h3),
.source-panel :where(strong, h1, h2, h3, .ranking-category-group h3),
.preview-panel :where(strong, h1, h2, h3),
.control-panel :where(strong, h1, h2, h3),
.result-panel :where(strong, h1, h2, h3),
.primary-button,
.sample-button,
.icon-button,
.result-rank {
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
}

.canvas-stack canvas {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 0;
  outline: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f7f9;
  box-shadow: 0 0 0 1px var(--line), 0 18px 42px rgba(17, 24, 39, 0.14);
  image-rendering: auto;
  transform: none;
  filter: none;
  opacity: 1;
  contain: paint;
}

.canvas-play-button,
.canvas-seek {
  font-weight: 700;
  text-rendering: auto;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

.canvas-play-button {
  position: relative;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(2, 6, 23, 0.16);
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78);
  font-size: 0;
  color: transparent;
}

.canvas-play-button::before,
.canvas-play-button::after {
  content: "";
  position: absolute;
  top: 50%;
  display: block;
  z-index: 1;
}

.canvas-play-button.is-playing::before,
.canvas-play-button.is-playing::after {
  width: 9px;
  height: 30px;
  border-radius: 3px;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: translateY(-50%);
}

.canvas-play-button.is-playing::before {
  left: 22px;
}

.canvas-play-button.is-playing::after {
  right: 22px;
}

.canvas-play-button.is-paused::before {
  left: 26px;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 24px solid #020617;
  transform: translateY(-50%);
}

.canvas-play-button.is-paused::after {
  display: none;
}

@media (max-width: 1220px) {
  .studio-grid {
    grid-template-columns: minmax(0, 1fr) 430px;
  }

  .control-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .button-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .studio-grid,
  .form-grid,
  #koreaPanel .form-grid,
  .national-toolbar,
  .korea-results-layout,
  .korea-stat-lines,
  .control-panel,
  .button-stack,
  .result-detail-blocks {
    grid-template-columns: 1fr;
  }

  .studio-grid {
    display: grid;
  }

  .preview-panel {
    width: min(430px, 100%);
  }

  .result-list {
    max-height: none;
  }
}

/* KBO layout sync: 20260520 */
.app-shell {
  min-width: 1840px;
  padding: 22px;
  background: #f3f5f8;
}

.topbar[aria-hidden="true"] {
  display: none;
}

.studio-grid {
  grid-template-columns: minmax(520px, 1fr) 430px 260px;
  gap: 18px;
  align-items: start;
}

.preview-panel {
  width: 430px;
  max-width: 430px;
}

.canvas-frame {
  width: 430px;
}

.canvas-stack {
  width: 430px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  background: #f6f7f9;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.canvas-stack canvas {
  border: 0;
  outline: 0;
  border-radius: 8px;
  background: #f6f7f9;
  box-shadow: none;
}

.control-panel.side-controls {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 12px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
  color: #000000;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.control-panel.side-controls .control-field {
  width: 100%;
  min-height: auto;
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  color: #000000;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
}

.control-panel.side-controls .control-title {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  color: #000000;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.control-panel.side-controls .duration-control .control-title {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.control-panel.side-controls .duration-readout {
  display: grid;
  justify-items: end;
  gap: 2px;
  white-space: nowrap;
}

.control-panel.side-controls .duration-readout strong {
  color: #000000;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.15;
}

.control-panel.side-controls .duration-readout em,
.control-panel.side-controls .bgm-control em,
.control-panel.side-controls .voice-toggle-control em {
  color: #000000;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.15;
}

.control-panel.side-controls input[type="range"] {
  width: 100%;
  accent-color: #e21d36;
}

.control-panel.side-controls .bgm-select,
.control-panel.side-controls .voice-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.34);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: #000000;
  font-size: 0.82rem;
  font-weight: 700;
}

.control-panel.side-controls .voice-toggle-control {
  min-height: 64px;
}

.control-panel.side-controls .voice-toggle-control .control-title {
  min-height: 38px;
}

.control-panel.side-controls .voice-toggle-control input[type="checkbox"] {
  justify-self: end;
  width: 18px;
  height: 18px;
  accent-color: #e21d36;
}

.control-panel.side-controls .record-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.control-panel.side-controls .record-panel .primary-button {
  width: 100%;
  min-height: 48px;
  height: 48px;
  border-radius: 8px;
}

.control-panel.side-controls .sr-status {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #c9d3df;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
  color: #000000;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.canvas-seek {
  border-color: #c9d3df;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
}

.canvas-seek-zone {
  display: block;
}

.canvas-seek {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.canvas-stack {
  overflow: hidden;
  border: 1px solid #c9d3df;
  border-bottom: 1px solid #c9d3df !important;
  border-radius: 8px;
  background: #f5f6f8;
  box-shadow: none !important;
}

.canvas-stack::after {
  display: none;
  content: none;
}

.canvas-stack canvas {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 1220px) {
  .app-shell {
    min-width: 0;
  }

  .studio-grid {
    grid-template-columns: minmax(0, 1fr) 430px;
  }

  .control-panel.side-controls {
    grid-column: 1 / -1;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

/* 20260528 layoutfix1: keep MLB source content in page flow, not nested scrolls. */
.source-panel {
  align-content: start;
}

.mode-tabs {
  height: 48px;
  min-height: 48px;
}

.mode-tab {
  height: 48px;
  min-height: 48px;
}

.mode-panel,
.ranking-category-list,
.result-list {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

