/* ─────────────────────────────────────────────
   1. ROOT VARIABLES & RESET
───────────────────────────────────────────── */
:root {
  /* ── 브랜드 컬러 ── */
  --green-deep: #0F3D2E;
  --green-forest: #1A5E46;
  --yellow: #C8A44D;
  --yellow-soft: #F4E2B1;
  --yellow-hover: #E4C374;

  /* ── 배경 ── */
  --bg: #FAFAF7;
  --bg-base: #FAFAF7;
  --bg-white: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.78);
  --white: #FFFFFF;

  /* ── 텍스트 ── */
  --text-dark: #111827;
  --text-gray: #4B5563;
  --text-light: #9CA3AF;
  --text-on-green-sub: #B7D4C7;

  /* ── 상태 컬러 ── */
  --danger: #DC2626;
  --success: #16A34A;
  --border: #E5E7EB;

  /* ── 그림자 ── */
  --shadow-sm: 0 2px 8px rgba(15, 61, 46, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 61, 46, 0.12);
  --shadow-lg: 0 20px 48px rgba(15, 61, 46, 0.16);
  --shadow-hover-soft: 0 9px 22px rgba(15, 61, 46, 0.12);
  --shadow-hover-strong: 0 12px 28px rgba(15, 61, 46, 0.16);

  /* ── 반지름 ── */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* ── 모션 ── */
  --transition: 200ms ease;
  --motion-fast: 180ms;
  --motion-micro: 140ms;
  --motion-base: 260ms;
  --motion-slow: 420ms;
  --easing-standard: cubic-bezier(0.2, 0.65, 0.25, 1);

  /* ── 인터랙션 ── */
  --focus-ring: 0 0 0 3px rgba(15, 61, 46, 0.2);
  --lift-hover: -2px;
  --lift-press: -1px;
  --touch-target: 46px;

  /* ── 타이머 고도화 (Emerald Gala Glow 팔레트) ── */
  --to-ok: #2D8F6F;
  --to-warn: #DAA520;
  --to-critical: #C77B4A;
  --to-expired: #6B8076;
  --to-accent: #D4AF37;
  --to-text-primary: #F0EBE0;
  --to-text-secondary: #A8BFB3;
  --to-ring-size: 280px;
  --to-ring-stroke: 8;
  --to-ring-circum: 326.73;
  --to-glass-bg: rgba(255, 255, 255, 0.06);
  --to-glass-border: rgba(255, 255, 255, 0.10);
  --to-glass-blur: 16px;
  --to-glow-ok: rgba(45, 143, 111, 0.35);
  --to-glow-warn: rgba(218, 165, 32, 0.4);
  --to-glow-critical: rgba(199, 123, 74, 0.5);
  --to-dur-fast: 180ms;
  --to-dur-mid: 320ms;
  --to-dur-slow: 900ms;
  --to-ease: cubic-bezier(0.2, 0.65, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 61, 46, 0.06), transparent 38%),
    radial-gradient(circle at 90% 16%, rgba(200, 164, 77, 0.10), transparent 34%),
    linear-gradient(180deg, #FAFAF7 0%, #FFFFFF 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(to right, rgba(15, 61, 46, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 61, 46, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
}

button:focus-visible,
.answer-option:focus-visible,
.option-item:focus-visible,
.btn-nav:focus-visible,
.btn-start:focus-visible,
.btn-submit:focus-visible,
.progress-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─────────────────────────────────────────────
   2. SCREEN SYSTEM
───────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ─────────────────────────────────────────────
   3. INTRO SCREEN
───────────────────────────────────────────── */
#intro-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.intro-card {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 61, 46, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out both;
}

.intro-logo {
  background:
    radial-gradient(circle at 12% 20%, rgba(200, 164, 77, 0.28), transparent 40%),
    linear-gradient(145deg, #114736 0%, #0b2e23 78%);
  padding: 36px 32px;
  text-align: center;
  position: relative;
}

.intro-logo::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: var(--white);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.brand-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-info {
  padding: 32px 32px 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-gray);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.info-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.intro-notice {
  margin: 16px 32px;
  background: var(--yellow-soft);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  border-left: 4px solid var(--yellow);
}

.intro-notice p {
  font-size: 0.875rem;
  color: var(--text-gray);
  line-height: 1.8;
}

.btn-start {
  display: block;
  width: calc(100% - 64px);
  margin: 16px 32px 32px;
  padding: 16px;
  background: var(--green-deep);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-start:hover {
  background: var(--green-forest);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-start:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

#selection-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.selection-card {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 61, 46, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out both;
}

.selection-body {
  padding: 26px 28px 30px;
}

.selection-section {
  margin-bottom: 18px;
}

.selection-title {
  font-size: 0.96rem;
  color: var(--text-gray);
  margin-bottom: 10px;
}

.selection-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selection-chip {
  min-height: var(--touch-target);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-gray);
  font-weight: 600;
  transition: all var(--transition);
}

.selection-chip:hover {
  border-color: var(--green-forest);
  color: var(--green-deep);
}

.selection-chip.active {
  border-color: var(--green-deep);
  background: rgba(15, 61, 46, 0.08);
  color: var(--green-deep);
}

.selection-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.selection-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--text-gray);
}

.selection-field input {
  width: 100%;
  min-height: var(--touch-target);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.94rem;
  color: var(--text-dark);
  background: #FFFFFF;
}

.selection-field input:focus {
  outline: none;
  border-color: var(--green-forest);
  box-shadow: var(--focus-ring);
}

.selection-error {
  min-height: 22px;
  color: var(--danger);
  font-size: 0.88rem;
  margin-bottom: 2px;
}

/* ─────────────────────────────────────────────
   4. TEST HEADER
───────────────────────────────────────────── */
.test-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-deep);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mini {
  font-size: 1rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -0.01em;
}

.test-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  letter-spacing: 0.06em;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 12px;
}

.timer-area {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.timer-icon {
  font-size: 1rem;
}

.timer-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'Pretendard', monospace;
  letter-spacing: 0.04em;
  color: var(--yellow);
  min-width: 5ch;
}

.timer-warning {
  color: var(--danger) !important;
  animation: pulse 1s ease-in-out infinite;
}

.timer-gauge {
  width: 100%;
  height: 6px;
  background: rgba(15,61,46,0.12);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.timer-gauge-fill {
  height: 100%;
  width: calc((1 - var(--timer-progress, 0)) * 100%);
  border-radius: 3px;
  transition: width 0.5s linear, background-color 0.8s var(--easing-standard, ease);
  background-color: var(--green-deep, #0F3D2E);
}

.timer-gauge-fill.gauge-yellow { background-color: var(--yellow, #C8A44D); }
.timer-gauge-fill.gauge-red { background-color: #D32F2F; }

/* ─────────────────────────────────────────────
   5. PROGRESS BAR
───────────────────────────────────────────── */
.progress-bar {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.progress-bar::-webkit-scrollbar {
  display: none;
}

.progress-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-gray);
  flex-shrink: 0;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-btn:hover {
  border-color: var(--green-forest);
  color: var(--green-deep);
  background: rgba(15, 61, 46, 0.04);
}

.progress-btn.active {
  background: var(--green-deep);
  color: var(--white);
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.2);
}

.progress-btn.answered {
  background: var(--yellow-soft);
  border-color: var(--yellow);
  color: var(--text-dark);
}

.progress-btn.answered.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--white);
}

/* ─────────────────────────────────────────────
   6. QUESTION AREA
───────────────────────────────────────────── */
.question-area {
  flex: 1;
  padding: 24px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
}

.question-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.question-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.question-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--bg);
}

.question-number {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green-deep);
}

.point-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--yellow-soft);
  color: var(--text-dark);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--yellow);
}

.question-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.question-text p {
  margin-bottom: 12px;
}

.question-text p:last-child {
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────
   6a. MULTIPLE CHOICE OPTIONS
───────────────────────────────────────────── */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
  position: relative;
}

.option-item:hover {
  border-color: var(--green-forest);
  background: rgba(15, 61, 46, 0.03);
}

.option-item.selected {
  border-color: var(--green-deep);
  background: rgba(15, 61, 46, 0.06);
}

.option-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: var(--white);
}

.option-item.selected .option-circle {
  border-color: var(--green-deep);
  background: var(--green-deep);
}

.option-item.selected .option-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
}

.option-label {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-dark);
  flex: 1;
}

.option-num {
  font-weight: 700;
  color: var(--text-gray);
  font-size: 0.9rem;
  flex-shrink: 0;
  min-width: 18px;
}

.option-item.selected .option-num {
  color: var(--green-deep);
}

/* ─────────────────────────────────────────────
   6b. SHORT ANSWER INPUT
───────────────────────────────────────────── */
.short-answer-area {
  margin-top: 8px;
}

.short-answer-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.short-answer-input {
  width: 100%;
  max-width: 280px;
  padding: 12px 16px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Pretendard', monospace;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  text-align: center;
}

.short-answer-input:focus {
  border-color: var(--green-deep);
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.12);
}

.short-answer-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

/* ─────────────────────────────────────────────
   6c. SUB-QUESTIONS
───────────────────────────────────────────── */
.sub-questions-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sub-question-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
}

.sub-question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sub-question-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-deep);
}

.sub-point-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(200, 164, 77, 0.15);
  color: var(--text-gray);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.sub-question-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 14px;
}

/* ─────────────────────────────────────────────
   7. NAVIGATION FOOTER
───────────────────────────────────────────── */
.nav-area {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.btn-nav {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-gray);
  background: var(--white);
  transition: all var(--transition);
}

.btn-nav:hover:not(:disabled) {
  border-color: var(--green-deep);
  color: var(--green-deep);
  background: rgba(15, 61, 46, 0.04);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.question-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-gray);
  margin: 0 auto;
}

.btn-submit {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--yellow);
  color: var(--green-deep);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.01em;
}

.btn-submit:hover {
  background: #B8943D;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-submit:active {
  transform: translateY(0);
}

/* ─────────────────────────────────────────────
   8. TIMER-ONLY MODE
───────────────────────────────────────────── */
#timer-only-screen.active {
  background: linear-gradient(
    155deg,
    #071e13 0%,
    #0b3022 40%,
    #0f3d2e 70%,
    #0c3225 100%
  );
}

.timer-only-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
  padding: 40px 24px;
}

.timer-only-brand {
  font-size: 1rem;
  font-weight: 800;
  color: var(--to-accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

.timer-only-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--to-text-secondary);
  letter-spacing: 0.06em;
}

.timer-adjust-panel {
  width: min(540px, 100%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.timer-adjust-row {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.timer-adjust-btn {
  min-height: 44px;
  min-width: 88px;
  padding: 0 24px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
}

.timer-minute-input {
  width: 108px;
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid rgba(212, 175, 55, 0.6);
  background: rgba(10, 32, 24, 0.45);
  color: var(--yellow);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  -moz-appearance: textfield;
}

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

.timer-preset-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.timer-preset-btn {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
}

.timer-preset-btn.active {
  background: var(--yellow);
  color: var(--green-deep);
  border-color: var(--yellow);
}

.timer-only-display {
  font-size: clamp(4rem, 15vw, 10rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--yellow);
  line-height: 1;
  font-family: 'Pretendard', monospace;
}

.timer-only-display.display-warn {
  color: #E8D5A3;
  text-shadow: 0 0 24px rgba(255, 213, 106, 0.38);
}

.timer-only-display.display-critical {
  color: #D4956A;
  text-shadow: 0 0 28px rgba(255, 107, 107, 0.45);
  animation: timerPulse 0.9s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.timer-only-controls {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

.btn-timer-ctrl {
  flex: 1;
  text-align: center;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-timer-ctrl:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.btn-timer-ctrl:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-timer-start {
  background: var(--to-accent);
  color: var(--green-deep);
  border-color: var(--to-accent);
}

.btn-timer-start:hover:not(:disabled) {
  background: #BF9B30;
  border-color: #BF9B30;
  color: var(--white);
}

.btn-timer-reset {
  border-color: rgba(168, 191, 179, 0.35);
  color: rgba(168, 191, 179, 0.75);
}

.btn-timer-reset:hover:not(:disabled) {
  background: rgba(45, 143, 111, 0.12);
  border-color: rgba(168, 191, 179, 0.55);
  color: var(--to-text-secondary);
}

/* ─────────────────────────────────────────────
   8-B. TIMER-ONLY OVERHAUL — SVG 링 + 레이아웃
───────────────────────────────────────────── */

/* 전체 컨테이너 재정의 */
.timer-only-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px 40px;
  gap: 0;
}

/* 상단 바 */
.to-topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 20px;
}

/* 상태 배지 */
.to-state-badge {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--to-text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  transition: background var(--to-dur-fast) var(--to-ease),
              color var(--to-dur-fast) var(--to-ease);
}

.timer-only-container[data-state="running"] .to-state-badge {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
}

.timer-only-container[data-state="warn"] .to-state-badge {
  color: var(--to-warn);
  background: rgba(218, 165, 32, 0.15);
  border-color: rgba(218, 165, 32, 0.3);
}

.timer-only-container[data-state="critical"] .to-state-badge {
  color: #D4956A;
  background: rgba(199, 123, 74, 0.15);
  border-color: rgba(199, 123, 74, 0.3);
}

.to-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--to-text-secondary);
  text-decoration: none;
  transition: color var(--to-dur-fast) var(--to-ease),
              background var(--to-dur-fast) var(--to-ease);
}

.to-home-btn:hover {
  color: var(--to-accent);
  background: rgba(255, 255, 255, 0.08);
}

.to-home-btn:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.7);
  outline-offset: 2px;
}

/* 메인 영역 */
.to-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 480px;
}

/* SVG 링 히어로 */
.to-ring-hero {
  position: relative;
  width: var(--to-ring-size);
  height: var(--to-ring-size);
  flex-shrink: 0;
}

/* SVG 링 — 공통 */
.to-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 링 트랙 (배경 원) */
.to-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: var(--to-ring-stroke);
  stroke-linecap: round;
}

/* 링 진행 (foreground 원) */
.to-ring-progress {
  fill: none;
  stroke: var(--to-ok);
  stroke-width: var(--to-ring-stroke);
  stroke-linecap: round;
  stroke-dasharray: var(--to-ring-circum);
  stroke-dashoffset: calc(var(--to-ring-circum) * (1 - var(--timer-progress, 0)));
  transform-origin: center;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.5s linear,
              stroke 0.4s var(--to-ease);
}

/* 상태별 링 색상 */
.timer-only-container[data-state="idle"] .to-ring-progress {
  stroke: var(--to-ok);
  opacity: 0.6;
}

.timer-only-container[data-state="running"] .to-ring-progress {
  stroke: var(--to-ok);
  opacity: 1;
}

.timer-only-container[data-state="warn"] .to-ring-progress {
  stroke: var(--to-warn);
}

.timer-only-container[data-state="critical"] .to-ring-progress {
  stroke: var(--to-critical);
}

.timer-only-container[data-state="expired"] .to-ring-progress {
  stroke: var(--to-expired);
  opacity: 0.5;
}

/* 중앙 시간 표시 래퍼 */
.to-display-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* 시간 표시 — 기존 .timer-only-display 스타일 보강 */
.to-display-wrapper .timer-only-display {
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1;
  color: var(--to-text-primary);
}

/* 상태별 배경 미묘한 변화 */
#timer-only-screen.active {
  background:
    radial-gradient(circle at 50% 30%, rgba(15, 61, 46, 0.4), transparent 60%),
    var(--green-deep);
}

.timer-only-container[data-state="warn"] ~ * ,
.timer-only-container[data-state="warn"] {
  --screen-accent: rgba(218, 165, 32, 0.06);
}

.timer-only-container[data-state="critical"] {
  --screen-accent: rgba(199, 123, 74, 0.08);
}

/* ─────────────────────────────────────────────
   9. RESULT SCREEN
───────────────────────────────────────────── */
#result-screen.active {
  background: var(--bg);
}

.result-container {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  animation: fadeIn 0.5s ease-out both;
}

.result-header {
  background:
    radial-gradient(circle at 12% 20%, rgba(200, 164, 77, 0.28), transparent 40%),
    linear-gradient(145deg, #114736 0%, #0b2e23 78%);
  color: var(--white);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 28px 32px;
  text-align: center;
}

.result-brand {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--yellow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.result-student-info {
  background: var(--white);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 16px 32px;
  font-size: 0.9rem;
  color: var(--text-gray);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.result-info-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.result-info-label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-info-value {
  font-weight: 700;
  color: var(--text-dark);
}

.total-score {
  background: var(--white);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.score-number {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 900;
  color: var(--green-deep);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  animation: countUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.score-max {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-light);
}

.tier-analysis {
  background: var(--white);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 24px 32px;
  border-top: 1px solid var(--bg);
}

.tier-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
}

.tier-row:last-child {
  border-bottom: none;
}

.tier-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-gray);
  min-width: 48px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tier-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.tier-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--green-forest);
  transition: width 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.tier-bar-fill.tier-color-high {
  background: var(--green-deep);
}

.tier-bar-fill.tier-color-mid {
  background: var(--yellow);
}

.tier-bar-fill.tier-color-low {
  background: var(--text-light);
}

.tier-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.question-results {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 24px 32px;
  border-top: 1px solid var(--bg);
}

.results-grid-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.results-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  border: 2px solid var(--border);
}

.result-circle.correct {
  background: rgba(22, 163, 74, 0.08);
  border-color: var(--success);
  color: var(--success);
}

.result-circle.incorrect {
  background: rgba(220, 38, 38, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}

.result-circle.unanswered {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-light);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ─────────────────────────────────────────────
   10. MODAL
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.2s ease both;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(16px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.95rem;
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 8px;
}

.modal-body:last-of-type {
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-modal-cancel {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-gray);
  background: var(--white);
  transition: all var(--transition);
}

.btn-modal-cancel:hover {
  border-color: var(--text-gray);
  color: var(--text-dark);
}

.btn-modal-confirm {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--danger);
  color: var(--white);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-modal-confirm:hover {
  background: #B91C1C;
}

/* ─────────────────────────────────────────────
   11. ANIMATIONS
───────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes countUp {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes timerExpiredFlash {
  0%, 100% {
    background: var(--bg);
  }
  50% {
    background: #FEE2E2;
  }
}

@keyframes fadeInUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.timer-expired-flash {
  animation: timerExpiredFlash 0.5s ease 3;
}

.fade-in-up {
  animation: fadeInUp 0.3s ease both;
}

.question-card {
  animation: fadeInUp 0.25s ease both;
}

/* ─────────────────────────────────────────────
   12. LOADING STATE
───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    rgba(229, 231, 235, 0.4) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────
   13. RESPONSIVE — MOBILE
───────────────────────────────────────────── */
@media (max-width: 640px) {
  #intro-screen {
    padding: 16px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .intro-card {
    margin: 0;
    border-radius: var(--radius-md);
  }

  .intro-logo {
    padding: 28px 24px;
  }

  .intro-info {
    padding: 24px 24px 12px;
  }

  .intro-notice {
    margin: 12px 24px;
  }

  .btn-start {
    width: calc(100% - 48px);
    margin: 12px 24px 24px;
  }

  .test-header {
    padding: 10px 16px;
  }

  .progress-bar {
    padding: 10px 16px;
    gap: 6px;
  }

  .progress-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .question-area {
    padding: 16px;
  }

  .question-card {
    padding: 20px 20px;
  }

  .nav-area {
    padding: 8px 16px;
    gap: 8px;
  }

  .btn-nav {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .btn-submit {
    padding: 8px 16px;
    font-size: 0.88rem;
  }

  .result-container {
    padding: 16px;
  }

  .result-header {
    padding: 20px 20px;
  }

  .result-student-info {
    padding: 14px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .total-score {
    padding: 24px 20px;
  }

  .tier-analysis {
    padding: 16px 20px;
  }

  .question-results {
    padding: 16px 20px;
  }

  .modal-card {
    padding: 24px;
  }

  .timer-only-display {
    font-size: clamp(3.5rem, 18vw, 7rem);
  }

  .timer-only-controls {
    flex-direction: column;
    align-items: center;
  }

  .timer-adjust-row {
    grid-template-columns: 1fr;
  }

  .timer-minute-input {
    width: 100%;
  }

  .btn-timer-ctrl {
    width: 200px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --to-ring-size: 220px;
  }

  .timer-only-controls {
    flex-direction: column;
  }

  .btn-timer-ctrl {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .progress-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .question-counter {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   8-C. TIMER-ONLY OVERHAUL — 글래스모피즘 카드 + 컨트롤
───────────────────────────────────────────── */

/* 글래스모피즘 카드 기본 */
.to-glass-card {
  width: min(480px, 100%);
  background: var(--to-glass-bg);
  border: 1px solid var(--to-glass-border);
  backdrop-filter: blur(var(--to-glass-blur));
  -webkit-backdrop-filter: blur(var(--to-glass-blur));
  border-radius: 18px;
  padding: 16px 20px;
  transition: border-color var(--to-dur-fast) var(--to-ease),
              background var(--to-dur-fast) var(--to-ease);
}

.to-glass-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

/* 컨트롤 카드 — 더 강조 (계층감 상단) */
.to-glass-card.to-controls-card {
  padding: 14px 20px;
  background: rgba(15, 61, 46, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* 시작 버튼 glow 효과 */
.btn-timer-start:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4),
              0 4px 12px rgba(212, 175, 55, 0.2);
  transform: translateY(-1px);
}

.btn-timer-start:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* 일반 버튼 press 효과 */
.btn-timer-ctrl:active:not(:disabled) {
  transform: scale(0.96);
}

/* 프리셋 버튼 호버 */
.timer-preset-btn:hover:not(:disabled):not(.active) {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.timer-preset-btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* 프리셋 active 상태 glow */
.timer-preset-btn.active {
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

/* disabled 상태 강화 */
.btn-timer-ctrl:disabled,
.timer-adjust-btn:disabled,
.timer-preset-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

/* 포커스 링 접근성 */
.btn-timer-ctrl:focus-visible,
.timer-adjust-btn:focus-visible,
.timer-preset-btn:focus-visible,
.timer-minute-input:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.7);
  outline-offset: 2px;
}

/* 상태별 카드 테두리 색상 변화 */
.timer-only-container[data-state="warn"] .to-glass-card {
  border-color: rgba(218, 165, 32, 0.2);
}

.timer-only-container[data-state="critical"] .to-glass-card {
  border-color: rgba(199, 123, 74, 0.2);
}

/* 타이머 조절 패널 오버라이드 — 덜 강조 (계층감 하단) */
.to-glass-card.timer-adjust-panel {
  background: rgba(15, 61, 46, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(var(--to-glass-blur));
  -webkit-backdrop-filter: blur(var(--to-glass-blur));
  border-radius: 18px;
}

/* 분 입력 필드 고도화 */
.timer-minute-input {
  transition: border-color var(--to-dur-fast) var(--to-ease),
              box-shadow var(--to-dur-fast) var(--to-ease);
}

.timer-minute-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  outline: none;
}

/* ─────────────────────────────────────────────
   15. UTILITY CLASSES
───────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.text-green {
  color: var(--green-deep);
}

.text-yellow {
  color: var(--yellow);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.fw-bold {
  font-weight: 700;
}

.fw-black {
  font-weight: 900;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.gap-8 {
  gap: 8px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

/* ===== T18: 결과 화면 상세 스타일 ===== */

/* 결과 학생 정보 */
.result-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #E5E7EB;
  font-size: 0.95rem;
  color: #374151;
}
.result-info-row:last-child { border-bottom: none; }
.result-info-row span:first-child { color: #6B7280; font-weight: 500; }
.result-info-row span:last-child { font-weight: 600; color: #0F3D2E; }

/* 등급별 점수 분석 */
.tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin: 4px 0;
  background: #F9FAFB;
  border-radius: 8px;
  border-left: 4px solid #0F3D2E;
}
.tier-name { font-size: 0.9rem; color: #374151; font-weight: 500; }
.tier-score { font-size: 0.9rem; color: #0F3D2E; font-weight: 700; }

/* 문항별 결과 그리드 */
.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
}
.question-result-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: default;
  transition: transform 0.2s;
}
.question-result-cell:hover { transform: scale(1.05); }
.question-result-cell.correct {
  background: #ECFDF5;
  border-color: #10B981;
}
.question-result-cell.wrong {
  background: #FEF2F2;
  border-color: #EF4444;
}
.cell-num {
  font-size: 0.75rem;
  color: #6B7280;
  font-weight: 500;
  margin-bottom: 2px;
}
.cell-mark {
  font-size: 1.1rem;
  font-weight: 700;
}
.question-result-cell.correct .cell-mark { color: #10B981; }
.question-result-cell.wrong .cell-mark { color: #EF4444; }

/* ===== T19: 등급별 애니메이션 ===== */

/* Gold shimmer — 90점 이상 */
@keyframes goldShimmer {
  0%   { text-shadow: 0 0 8px rgba(200,164,77,0.4); }
  50%  { text-shadow: 0 0 24px rgba(200,164,77,0.9), 0 0 48px rgba(200,164,77,0.4); }
  100% { text-shadow: 0 0 8px rgba(200,164,77,0.4); }
}
.score-tier-gold {
  color: #C8A44D !important;
  animation: goldShimmer 2s ease-in-out infinite;
}

/* Green grow — 70-89점 */
@keyframes greenGrow {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.score-tier-green {
  color: #0F3D2E !important;
  animation: greenGrow 2.5s ease-in-out infinite;
}

/* Default — 50-69점 */
.score-tier-default {
  color: #374151 !important;
}

/* Gray fade — 50점 미만 */
@keyframes grayFade {
  0%   { opacity: 1; }
  50%  { opacity: 0.6; }
  100% { opacity: 1; }
}
.score-tier-gray {
  color: #9CA3AF !important;
  animation: grayFade 3s ease-in-out infinite;
}

/* ─── 수능 성적표 스타일 ─── */

/* 상단 수험정보 영역 */
.result-exam-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.result-exam-header .exam-info-item {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.result-exam-header .exam-info-label {
  font-weight: 700;
  color: var(--text-gray);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-exam-header .exam-info-value {
  font-weight: 700;
  color: var(--text-dark);
}

/* 수능 성적표 테이블 */
.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.score-table th,
.score-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.score-table th {
  background: var(--green-deep);
  color: var(--white);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-table td {
  background: var(--white);
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
}

.score-table tbody tr:nth-child(even) td {
  background: #FAFAF7;
}

.score-table tbody tr:hover td {
  background: rgba(15, 61, 46, 0.04);
}

/* tier별 첫 번째 열(영역명) 강조 */
.score-table .tier-row-basic td:first-child,
.score-table .tier-row-intermediate td:first-child,
.score-table .tier-row-advanced td:first-child,
.score-table .tier-row-expert td:first-child {
  font-weight: 700;
  color: var(--green-deep);
  letter-spacing: 0.02em;
}

/* tier별 왼쪽 accent 선 */
.score-table .tier-row-basic td:first-child {
  border-left: 3px solid #86EFAC;
}

.score-table .tier-row-intermediate td:first-child {
  border-left: 3px solid #4ADE80;
}

.score-table .tier-row-advanced td:first-child {
  border-left: 3px solid #22C55E;
}

.score-table .tier-row-expert td:first-child {
  border-left: 3px solid var(--green-deep);
}

/* 종합 등급 뱃지 */
.total-grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 16px;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.grade-gold {
  background: linear-gradient(135deg, #C8A44D, #E4C374);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(200, 164, 77, 0.35);
}

.grade-green {
  background: var(--green-deep);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(15, 61, 46, 0.25);
}

.grade-default {
  background: var(--text-gray);
  color: var(--white);
}

/* 대시보드 이동 버튼 */
.result-dashboard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--yellow);
  color: var(--green-deep);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: transform 0.18s var(--easing-standard, ease), box-shadow 0.18s var(--easing-standard, ease);
  box-shadow: 0 2px 8px rgba(200, 164, 77, 0.3);
  text-decoration: none;
}

.result-dashboard-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 164, 77, 0.45);
}

.result-dashboard-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(200, 164, 77, 0.3);
}

/* ─────────────────────────────────────────────
   T4: 버튼 호버 + 접근성 + 터치/모션 처리
───────────────────────────────────────────── */

/* ─── 답변 옵션 베이스 (position:relative 보장) ─── */
.answer-option {
  position: relative;
  transition:
    transform var(--motion-fast) var(--easing-standard),
    box-shadow var(--motion-fast) var(--easing-standard),
    background var(--motion-fast) var(--easing-standard);
}

/* ─── 버튼 호버/리프트 효과 ─── */
.btn-primary:hover,
.btn-secondary:hover,
button:hover {
  transform: translateY(var(--lift-hover));
  box-shadow: var(--shadow-hover-soft);
}

.btn-primary:active,
button:active {
  transform: translateY(var(--lift-press));
}

/* ─── 답변 옵션 호버 ─── */
.option-item:hover,
.answer-option:hover {
  background: linear-gradient(135deg, rgba(15, 61, 46, 0.06) 0%, rgba(200, 164, 77, 0.08) 100%);
  transform: translateY(var(--lift-hover));
  box-shadow: var(--shadow-hover-soft);
}

/* ─── 답변 옵션 선택됨 ─── */
.option-item.selected,
.answer-option.selected {
  background: linear-gradient(140deg, rgba(200, 164, 77, 0.45), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 2px var(--green-deep), var(--shadow-hover-soft);
}

.option-item.selected::after,
.answer-option.selected::after {
  content: '✓';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green-deep);
  font-weight: 700;
  font-size: 1.1rem;
}

/* ─── disabled 상태 ─── */
button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.78);
  transform: none;
  box-shadow: none;
}

/* ─── 터치 디바이스 hover 비활성화 ─── */
@media (hover: none) {
  button:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .answer-option:hover,
  .option-item:hover {
    transform: none;
    box-shadow: none;
  }

  .answer-option:hover:not(.selected),
  .option-item:hover:not(.selected) {
    background: var(--white);
  }

  button,
  .answer-option,
  .option-item {
    -webkit-tap-highlight-color: transparent;
    min-height: var(--touch-target, 46px);
  }
}

/* ─── 모션 감소 선호 ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ─── T5: 제출 이원화 버튼 그룹 ─── */
.submit-btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-submit-direct {
  background: var(--green-deep, #0F3D2E);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--motion-fast, 180ms) var(--easing-standard, ease), box-shadow var(--motion-fast, 180ms) var(--easing-standard, ease);
}
.btn-submit-direct:hover {
  transform: translateY(var(--lift-hover, -2px));
  box-shadow: var(--shadow-hover-soft, 0 9px 22px rgba(15, 61, 46, 0.12));
}
.btn-submit-review {
  background: var(--yellow, #C8A44D);
  color: var(--green-deep, #0F3D2E);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--motion-fast, 180ms) var(--easing-standard, ease), box-shadow var(--motion-fast, 180ms) var(--easing-standard, ease);
}
.btn-submit-review:hover {
  transform: translateY(var(--lift-hover, -2px));
  box-shadow: var(--shadow-hover-soft, 0 9px 22px rgba(15, 61, 46, 0.12));
}
.submit-hint {
  font-size: 0.75rem;
  color: var(--text-gray, #6B7280);
  margin-top: 4px;
  text-align: center;
}

.btn-print-paper {
  background: #fff;
  color: var(--green-deep, #0F3D2E);
  border: 1px solid rgba(15, 61, 46, 0.25);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--motion-fast, 180ms) var(--easing-standard, ease), box-shadow var(--motion-fast, 180ms) var(--easing-standard, ease);
}

.btn-print-paper:hover:enabled {
  transform: translateY(var(--lift-hover, -2px));
  box-shadow: var(--shadow-hover-soft, 0 9px 22px rgba(15, 61, 46, 0.12));
}

.btn-print-paper:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#print-sheet-screen {
  display: none;
}

.print-paper {
  background: #fff;
}

.print-paper-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 6mm;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 2mm;
}

.print-brand {
  font-size: 11pt;
  font-weight: 700;
  color: #0F3D2E;
}

.print-title {
  font-size: 14pt;
  font-weight: 800;
  color: #111827;
}

.print-meta {
  font-size: 9.5pt;
  color: #4b5563;
}

.print-question-grid {
  column-count: 1;
  column-gap: 7mm;
}

.print-question-grid.two-column {
  column-count: 2;
}

.print-question-wrap {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 4.2mm;
}

.print-paper .question-card {
  border: 1px solid #d1d5db;
  border-radius: 3mm;
  box-shadow: none;
  background: #fff;
}

.print-paper .question-header,
.print-paper .question-text,
.print-paper .sub-question-text,
.print-paper .option-item,
.print-paper .option-text,
.print-paper .sub-question-header {
  text-align: left;
}

.print-paper .option-item {
  min-height: 0;
  padding: 1.2mm 0;
  border: none;
  box-shadow: none;
  transform: none;
}

.print-paper .option-item:hover,
.print-paper .option-item.selected {
  background: transparent;
}

.print-memo-line {
  margin-top: 1.8mm;
  border-top: 1px dashed #d1d5db;
  padding-top: 1.4mm;
  font-size: 8.5pt;
  color: #6b7280;
}

@media print {
  @page {
    size: A4;
    margin-top: 10mm;
    margin-right: 10mm;
    margin-bottom: 10mm;
    margin-left: 10mm;
  }

  body {
    background: #fff;
  }

  body * {
    visibility: hidden !important;
  }

  #print-sheet-screen,
  #print-sheet-screen * {
    visibility: visible !important;
  }

  #print-sheet-screen {
    display: block !important;
    position: static;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  #print-sheet {
    width: 100%;
  }

  .print-paper {
    width: 100%;
    min-height: 276mm;
    page-break-after: always;
  }

  .print-paper:last-child {
    page-break-after: auto;
  }
}

/* === Section 8-D: 글로우/플로우 집중 애니메이션 === */

@keyframes to-ring-breathe {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(45,143,111,0.3)); }
  50%      { filter: drop-shadow(0 0 40px rgba(45,143,111,0.65)); }
}

@keyframes to-glow-drift {
  0%, 100% {
    opacity: 0.85;
    filter: drop-shadow(0 0 8px rgba(45,143,111,0.6));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 24px rgba(45,143,111,0.95));
  }
}

@keyframes to-card-shimmer {
  0%   { border-color: rgba(255,255,255,0.08); }
  50%  { border-color: rgba(255,255,255,0.16); }
  100% { border-color: rgba(255,255,255,0.08); }
}

@keyframes to-critical-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(199,123,74,0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(199,123,74,0.7)); }
}

@keyframes to-fade-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 애니메이션 적용 */
.to-ring-hero {
  animation: to-ring-breathe 4s ease-in-out infinite;
}

.timer-only-container[data-state="running"] .to-ring-progress {
  animation: to-glow-drift 3s ease-in-out infinite;
}

.timer-only-container[data-state="running"] .to-glass-card {
  animation: to-card-shimmer 5s ease-in-out infinite;
}

.timer-only-container[data-state="critical"] .to-ring-svg {
  animation: to-critical-pulse 1.2s ease-in-out infinite;
}

.to-glass-card {
  animation: to-fade-enter 0.5s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .to-ring-hero,
  .to-ring-progress,
  .to-glass-card,
  .to-ring-svg {
    animation: none !important;
    transition: none !important;
  }
}
