/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --red-50: #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 720px;
  --container: 960px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--blue-600);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ===== Header ===== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-icon { flex-shrink: 0; }
.site-nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
}
.site-nav a {
  font-size: .9rem;
  color: var(--gray-600);
  font-weight: 500;
}
.site-nav a:hover { color: var(--blue-600); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 50%, var(--blue-500) 100%);
  color: var(--white);
  padding: 64px 0 72px;
}
.badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 1.1rem;
  opacity: .9;
  max-width: 560px;
  margin-bottom: 32px;
  line-height: 1.5;
}
.hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}
.stat-label {
  font-size: .8rem;
  opacity: .8;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--font);
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--blue-600);
  color: var(--white);
  border-color: var(--blue-600);
}
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-ghost {
  background: transparent;
  color: var(--blue-600);
  border-color: var(--blue-200);
}
.btn-ghost:hover { background: var(--blue-50); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* ===== Quiz Section ===== */
.quiz-section {
  padding: 48px 0 64px;
}
.quiz-shell {
  max-width: var(--max-width);
  margin: 0 auto;
}
.quiz-progress {
  margin-bottom: 24px;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--blue-600);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-text {
  font-size: .85rem;
  color: var(--gray-500);
  font-weight: 500;
}

.quiz-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  border: 1px solid var(--gray-200);
}

.question-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue-600);
  margin-bottom: 8px;
}
.question-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  line-height: 1.3;
}
.question-visual {
  margin-bottom: 12px;
}
.question-hint {
  font-size: .9rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* Box visual */
.box-visual {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  background: var(--blue-50);
  border: 2px dashed var(--blue-200);
  border-radius: var(--radius);
}
.box-visual .box-emoji { font-size: 2rem; }
.box-visual .box-label { font-size: .8rem; color: var(--gray-500); font-weight: 500; }

/* Guess form */
.guess-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--gray-700);
}
.input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
  background: var(--white);
}
.input-wrapper:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.input-wrapper input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-size: 1.1rem;
  font-family: var(--font);
  color: var(--gray-900);
  outline: none;
  min-width: 0;
}
.input-suffix {
  padding: 0 14px;
  font-weight: 600;
  color: var(--gray-400);
  font-size: .9rem;
}
.input-hint {
  font-size: .8rem;
  color: var(--gray-400);
}

/* Result panel */
.result-panel {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  animation: fadeSlide .3s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.result-emoji { font-size: 2.5rem; }
.result-numbers p { margin-bottom: 2px; }
.result-actual { font-size: 1rem; color: var(--gray-700); }
.result-your-guess { font-size: .9rem; color: var(--gray-500); }
.result-diff { font-size: .9rem; font-weight: 600; }
.result-diff.close { color: var(--green-600); }
.result-diff.off { color: var(--amber-600); }
.result-diff.wide { color: var(--red-600); }

.result-verdict {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 12px;
}
.result-verdict.safe {
  background: var(--green-50);
  color: var(--green-600);
  border: 1px solid #bbf7d0;
}
.result-verdict.caution {
  background: var(--amber-50);
  color: var(--amber-600);
  border: 1px solid #fde68a;
}
.result-verdict.danger {
  background: var(--red-50);
  color: var(--red-600);
  border: 1px solid #fecaca;
}

.result-tip {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--blue-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--blue-500);
}
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Score panel */
.score-panel {
  text-align: center;
  padding: 48px 36px;
}
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--blue-50);
  border: 4px solid var(--blue-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.score-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--blue-700);
  line-height: 1;
}
.score-total {
  font-size: .9rem;
  color: var(--gray-400);
}
.score-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.score-message {
  color: var(--gray-500);
  margin-bottom: 24px;
}
.score-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.score-history {
  border-top: 1px solid var(--gray-200);
  padding-top: 24px;
}
.score-history h3 {
  font-size: .95rem;
  color: var(--gray-600);
  margin-bottom: 12px;
}
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.history-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--gray-600);
}
.history-list li .score-val { font-weight: 700; color: var(--blue-600); }

/* ===== Info Section ===== */
.info-section {
  padding: 64px 0;
  background: var(--white);
}
.info-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--gray-900);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.info-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.info-icon { margin-bottom: 16px; }
.info-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}
.info-card p {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ===== Tips Section ===== */
.tips-section {
  padding: 64px 0;
}
.tips-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--gray-900);
}
.tips-list {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tip-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tip-item summary {
  padding: 18px 24px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-800);
  list-style: none;
}
.tip-item summary::-webkit-details-marker { display: none; }
.tip-item summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--gray-400);
  font-weight: 400;
}
.tip-item[open] summary::after { content: '−'; }
.tip-item summary:hover { background: var(--gray-50); }
.tip-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tip-item p {
  padding: 0 24px 20px 64px;
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ===== Safe Limits Table ===== */
.safe-limits-section {
  padding: 64px 0;
  background: var(--white);
}
.safe-limits-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  color: var(--gray-900);
}
.table-wrapper {
  overflow-x: auto;
  max-width: var(--max-width);
  margin: 0 auto;
}
.limits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.limits-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.limits-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-600);
  vertical-align: top;
}
.limits-table tr:last-child td { border-bottom: none; }
.limits-table tr:hover td { background: var(--gray-50); }

/* ===== FAQ Section ===== */
.faq-section {
  padding: 64px 0;
}
.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--gray-900);
}
.faq-list {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.faq-item dt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.faq-item dd {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 40px 0;
  font-size: .85rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-brand a { color: var(--blue-200); }
.footer-nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
}
.footer-nav a { color: var(--gray-400); }
.footer-nav a:hover { color: var(--white); }
.footer-note { font-size: .8rem; color: var(--gray-500); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-inner { height: 52px; }
  .site-nav ul { gap: 12px; }
  .site-nav a { font-size: .8rem; }
  .hero { padding: 40px 0 48px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-sub { font-size: .95rem; }
  .hero-stats { gap: 20px; }
  .quiz-card { padding: 24px; }
  .question-title { font-size: 1.1rem; }
  .info-grid { grid-template-columns: 1fr; }
  .score-panel { padding: 32px 20px; }
  .tip-item p { padding-left: 24px; }
}

@media (max-width: 400px) {
  .hero-stats { flex-direction: column; gap: 12px; align-items: flex-start; }
  .score-actions { flex-direction: column; align-items: center; }
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .hero, .quiz-section, .score-actions, .score-history { display: none; }
  body { background: white; color: black; }
  .info-section, .tips-section, .safe-limits-section, .faq-section { padding: 16px 0; }
  .info-card, .tip-item { break-inside: avoid; }
}

/* ===== Focus styles ===== */
:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* ===== Utility ===== */
[hidden] { display: none !important; }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
