/* 화면별 전용 레이아웃 */

/* ================= 홈 화면 (colorguesserdesign-referencemain-reference.html 참고) ================= */

.home-screen .screen-inner {
  align-items: stretch;
  gap: 0;
  padding: 0;
  max-width: none;
}

.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-5) clamp(var(--space-5), 5vw, var(--space-8));
  border-bottom: var(--border-width-thick) solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-page);
}

/* 레퍼런스의 마우스 추적 스포트라이트 (히어로 영역에만 적용) */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: clamp(var(--space-7), 6vw, 64px);
  padding: clamp(40px, 9vw, 96px) clamp(var(--space-5), 5vw, var(--space-8)) clamp(32px, 6vw, 64px);
  background-image: radial-gradient(
    700px circle at var(--mx, 50%) var(--my, 25%),
    color-mix(in srgb, var(--text-primary) 6%, transparent),
    transparent 60%
  );
}

.home-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
}

.home-logo {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

.home-hero__meta {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  font-weight: var(--font-weight-bold);
}

.home-hero__meta strong {
  color: var(--color-secondary-dark);
}

.home-hero__visual {
  justify-self: end;
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  backdrop-filter: blur(6px);
  border: var(--border-width) solid color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.home-hero__grid {
  display: grid;
  grid-template-columns: repeat(3, clamp(52px, 15vw, 76px));
  gap: clamp(var(--space-2), 2vw, var(--space-3));
}

.home-hero__cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.home-hero__cell--offset {
  transform: translateY(10px);
}

.home-hero__cell--accent {
  background: var(--color-primary);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1.08);
}

.home-divider {
  height: 2px;
  border: 0;
  margin: 0 clamp(var(--space-5), 5vw, var(--space-8));
  background: var(--border-color);
}

.home-categories-section {
  padding: clamp(40px, 8vw, 96px) clamp(var(--space-5), 5vw, var(--space-8));
}

.home-categories-section__title {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-7);
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) clamp(var(--space-5), 5vw, var(--space-8));
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* ================= 카테고리 목록 화면 ================= */

.categories-screen__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-5);
}

/* ================= 카테고리 상세 화면 (NFL.dc.html 히어로 스타일) ================= */

.category-hero {
  position: relative;
  min-height: clamp(360px, 55vh, 560px);
  display: flex;
  align-items: flex-end;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-card-muted);
}

.category-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px);
  transform: scale(1.03);
  z-index: 0;
}

.category-hero__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  pointer-events: none;
}

.category-hero__card {
  position: relative;
  z-index: 2;
  max-width: 520px;
  width: calc(100% - var(--space-8));
  margin: var(--space-6);
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #ffffff, var(--bg-card-muted));
  box-shadow: var(--shadow-lg);
}

.category-hero__eyebrow {
  font-size: 12px;
  font-weight: var(--font-weight-black);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary-dark);
  margin-bottom: var(--space-3);
}

.category-hero__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-black);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
}

.category-hero__desc {
  font-size: var(--font-size-md);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 var(--space-4);
}

.category-hero__tags {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

/* ================= 게임 화면 ================= */

.game-screen .screen-inner {
  gap: var(--space-4);
}

.game-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-page);
}

.game-header .top-bar {
  position: static;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
}

.game-progress-text {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  white-space: nowrap;
}

.game-layout {
  display: flex;
  gap: var(--space-6);
  flex: 1;
  align-items: stretch;
}

.game-photo-pane {
  flex: 1.15;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  align-self: flex-start;
}

.game-photo-frame {
  position: relative;
  flex: 1;
  width: 100%;
  border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--border-color);
  overflow: hidden;
  background: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: 420px;
  max-width: 420px;
  margin: 0 auto;
}

.game-photo-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-photo-frame__loading,
.game-photo-frame__error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: var(--bg-card-muted);
  color: var(--text-secondary);
  font-weight: var(--font-weight-bold);
  text-align: center;
  padding: var(--space-4);
}

.game-question-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
}

.game-control-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 400px;
}

/* ---- 커스텀 컬러 피커 ---- */

.color-picker {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sv-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  border: var(--border-width) solid var(--border-color);
}

.sv-panel canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sv-panel__thumb {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35), var(--shadow-sm);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-slider {
  position: relative;
  width: 100%;
  height: 26px;
  border-radius: var(--radius-pill);
  touch-action: none;
  cursor: pointer;
  border: var(--border-width) solid var(--border-color);
}

.hue-slider__thumb {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35), var(--shadow-sm);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.lightness-slider {
  position: relative;
  width: 100%;
  height: 26px;
  border-radius: var(--radius-pill);
  touch-action: none;
  cursor: pointer;
  border: var(--border-width) solid var(--border-color);
}

.lightness-slider__thumb {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35), var(--shadow-sm);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-picker__preview {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.color-picker__hex {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.color-picker__hex-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ================= 결과(라운드) 화면 ================= */

.round-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  max-width: 480px;
  width: 100%;
  margin: var(--space-4) auto 0;
  padding: clamp(var(--space-6), 5vw, var(--space-8)) var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #ffffff, var(--bg-card-muted));
  box-shadow: var(--shadow-lg);
}

.round-result__score-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: var(--font-weight-bold);
}

.round-result__comment {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary-dark);
}

.round-result__compare {
  display: flex;
  gap: var(--space-4);
  width: 100%;
}

.round-result__photo {
  flex: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.round-result__photo canvas,
.round-result__photo img {
  width: 100%;
  display: block;
}

.round-result__photo-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.round-result__colors {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: center;
}

.round-result__color-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.round-result__color-name {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-bold);
}

/* ================= 최종 결과 화면 ================= */

.final-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  max-width: 480px;
  width: 100%;
  margin: var(--space-4) auto 0;
  padding: clamp(var(--space-6), 5vw, var(--space-8)) var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #ffffff, var(--bg-card-muted));
  box-shadow: var(--shadow-lg);
}

.final-result__total {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  color: var(--color-secondary-dark);
}

.final-result__new-best {
  color: var(--color-secondary-dark);
  font-weight: var(--font-weight-bold);
}

.final-result__list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.final-result__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
}

.final-result__row-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.final-result__row-title {
  flex: 1;
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.final-result__row-score {
  font-weight: var(--font-weight-black);
  color: var(--color-secondary-dark);
}

.final-result__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
