:root {
  --panel: #ffffff;
  --panel-border: rgba(0, 0, 0, 0.08);
  --text: #111827;
  --muted: #6b7280;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  --radius: 10px;
}

* { box-sizing: border-box; }

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

.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;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-nav {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 10px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  padding: 4px;
  margin: -4px;
}
.brand .material-symbols-rounded {
  color: #ea580c;
  font-size: 21px;
}
.brand-logo {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}
.language-switcher {
  position: relative;
  display: flex;
  margin-left: 0;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 116px;
  height: 36px;
  padding: 0 10px 0 12px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.language-trigger:hover:not(:disabled) {
  filter: none;
  border-color: rgba(0, 0, 0, 0.18);
}
.language-trigger .material-symbols-rounded {
  color: #6b7280;
  font-size: 18px;
}
.language-trigger .expand-icon {
  margin-left: auto;
  font-size: 18px;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 100%;
  width: max-content;
  padding: 4px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}
.language-menu[hidden] {
  display: none;
}
.language-option {
  display: block;
  width: auto;
  min-width: 100%;
  height: 34px;
  padding: 0 10px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: transparent;
  border-radius: 7px;
}
.language-option:hover:not(:disabled) {
  filter: none;
  color: #111827;
  background: #f3f4f6;
}
.language-option.active {
  color: #111827;
  background: #f3f4f6;
}
.nav-links {
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link .material-symbols-rounded { font-size: 18px; }
.nav-link:hover { color: #111827; }
@media (min-width: 1024px) {
  .site-nav { padding: 10px 32px; }
}

.site-footer {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  margin-top: 48px;
  padding: 48px 24px;
}
.footer-inner { max-width: 80rem; margin: 0 auto; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 48px;
  margin-bottom: 40px;
}
.footer-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}
.footer-link:hover { color: #111827; }
.footer-copy {
  margin: 32px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: #9ca3af;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(17, 24, 39, 0.06), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, #f3f4f6 52%, #eef2f7 100%);
  padding: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, black 62%, transparent 100%);
}

.container { max-width: 1200px; margin: 0 auto; padding: 40px 18px 32px; }

.header { text-align: center; margin-bottom: 24px; }
.header h1 { font-size: clamp(24px, 3.5vw, 36px); margin: 0 0 10px; font-weight: 700; }
.header p { margin: 0 auto; max-width: 760px; color: var(--muted); line-height: 1.65; font-size: 15px; }

.merged-card {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.home-section {
  max-width: 1100px;
  margin: 64px auto 0;
}
.section-head {
  text-align: center;
  margin-bottom: 28px;
}
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  color: #111827;
}
.section-head p {
  margin: 0 auto;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.page-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 18px 32px;
}
.page-hero {
  margin-bottom: 28px;
}
.page-kicker {
  margin: 0 0 10px;
  color: #ea580c;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  color: #111827;
}
.page-hero p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.content-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
.content-card h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  line-height: 1.3;
  color: #111827;
}
.content-card h2:first-child { margin-top: 0; }
.content-card p,
.content-card li {
  color: #374151;
  font-size: 15px;
  line-height: 1.75;
}
.content-card p {
  margin: 0 0 14px;
}
.content-card ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.content-card a {
  color: #ea580c;
  font-weight: 600;
}
.updated-note {
  margin-top: 28px;
  color: #9ca3af;
  font-size: 13px;
}
#faq .section-head {
  max-width: 1040px;
  margin: 0 auto 32px;
  text-align: left;
}
#faq .section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}
#faq .section-head p { display: none; }

.step-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.step-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff7ed;
  color: #ea580c;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}
.step-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.why-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.why-text p {
  margin: 0 0 12px;
  color: #374151;
  font-size: 14px;
  line-height: 1.7;
}
.why-text p:last-child { margin-bottom: 0; }
.why-text strong { color: #111827; }
.why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.why-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.why-list li .material-symbols-rounded {
  color: #ea580c;
  font-size: 20px;
  flex-shrink: 0;
}
.why-list li div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.why-list li strong {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.why-list li span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(234, 88, 12, 0.4);
}
.game-card-body { min-width: 0; }
.game-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.game-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.game-card-arrow {
  font-size: 18px;
  color: #9ca3af;
  flex-shrink: 0;
}
.game-card:hover .game-card-arrow { color: #ea580c; }

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 42px;
  max-width: 1040px;
  margin: 0 auto;
}
.faq-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.faq-item h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: #111827;
}
.faq-item h3 span {
  flex-shrink: 0;
  color: #f59e0b;
  font-weight: 700;
}
.faq-item p {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; padding: 22px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq-list { gap: 18px; }
}
@media (max-width: 640px) {
  .home-section { margin-top: 40px; }
  .step-grid { grid-template-columns: 1fr; gap: 10px; }
  .step-card { padding: 16px; }
  .why-grid { padding: 16px; gap: 16px; }
  .why-list { grid-template-columns: 1fr; }
  .game-grid { gap: 10px; }
  .game-card { padding: 14px; }
  .page-shell { padding: 40px 14px 24px; }
  .content-card { padding: 22px; }
  .faq-list { grid-template-columns: 1fr; }
  .faq-item { padding: 18px; }
  .faq-item h3 { font-size: 14px; }
  .faq-item p { padding-left: 21px; }
}

.panel-left {
  flex: 0 0 420px;
  min-width: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
}

.panel-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.card-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}
.title-icon {
  color: #ea580c;
  font-size: 21px;
}
.card-header p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 14px; }

.card-body { padding: 22px 24px 24px; }

.field-label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--muted); }

.input-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.input-control {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}

input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 42px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #ffffff;
  color: var(--text);
  padding: 0 46px 0 14px;
  font-size: 15px;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
  transition: border-color 0.15s ease;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.number-stepper {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 38px;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0 5px 5px 0;
  background: #ffffff;
}

.stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
}
.stepper-btn::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.stepper-btn:first-child::before {
  border-bottom: 5px solid #8b8b8b;
}
.stepper-btn:last-child::before {
  border-top: 5px solid #8b8b8b;
}
.stepper-btn:hover:not(:disabled) {
  filter: none;
  background: #f3f4f6;
}
.stepper-btn:first-child:hover:not(:disabled)::before {
  border-bottom-color: #4b5563;
}
.stepper-btn:last-child:hover:not(:disabled)::before {
  border-top-color: #4b5563;
}

input[type="number"]:focus { border-color: #111827; }
input[type="number"]:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease, filter 0.15s ease;
}
button:hover:not(:disabled) { filter: brightness(0.92); }
button:disabled { cursor: not-allowed; opacity: 0.38; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  background: #ffffff;
  color: #374151;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.ghost-btn .material-symbols-rounded { font-size: 18px; }

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 20px 0 14px;
  flex-wrap: wrap;
}

.status-chip {
  padding: 6px 12px;
  border-radius: 4px;
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.hint { color: var(--muted); font-size: 13px; line-height: 1.7; }

.message { margin-top: 10px; min-height: 22px; font-size: 14px; color: #374151; }
.message.is-error { color: #dc2626; }

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.value-box {
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 16px 10px;
  text-align: center;
}
.value-box .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.value-box .num { font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.value-box.active {
  border-color: #111827;
  background: #f3f4f6;
}

.choice-area {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 14px;
}

.choice-btn { flex: 1; height: 38px; border-radius: 6px; padding: 0 14px; text-align: center; color: white; display: flex; align-items: center; justify-content: center; gap: 6px; }
.choice-btn .material-symbols-rounded { font-size: 19px; }
.choice-btn strong { font-size: 14px; font-weight: 600; }
.choice-lower { background: #ea580c; }
.choice-higher { background: #16a34a; }

.final-result {
  display: none;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.final-result.show { display: block; }
.final-result .kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #16a34a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 700;
}
.final-result .kicker .material-symbols-rounded { font-size: 16px; }
.final-result .big-val {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #111827;
}
.final-result .desc { color: #374151; line-height: 1.5; font-size: 12px; }

.sens-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.sens-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.sens-table th:not(:first-child) { text-align: right; }

.sens-table td {
  padding: 11px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text);
}
.sens-table td:not(:first-child) { text-align: right; }
.sens-table td.base-val { color: #ea580c; font-weight: 600; }
.sens-table tbody tr:last-child td { border-bottom: none; }

.sens-table .empty-row td {
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
  text-align: center !important;
}

.left-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.left-card-header > div { min-width: 0; }

.reset-btn {
  flex-shrink: 0;
  margin-top: 2px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .merged-card { flex-direction: column; }
  .panel-left {
    flex: none;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }
}

@media (max-width: 640px) {
  .container { padding: 20px 8px 10px; }

  .site-nav { gap: 12px; padding: 8px 12px; }
  .brand { gap: 6px; }
  .brand-logo { width: 22px; height: 22px; }
  .nav-links { gap: 12px; }
  .nav-link { height: 32px; font-size: 13px; }
  .nav-link .material-symbols-rounded { font-size: 16px; }
  .language-trigger { min-width: 0; height: 32px; padding: 0 8px 0 10px; font-size: 13px; }
  .language-trigger .material-symbols-rounded { font-size: 16px; }
  .language-trigger .expand-icon { font-size: 16px; }
  .language-trigger .current-language { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .card-header { padding: 12px 12px 10px; }
  .card-body   { padding: 12px 12px 14px; }
  .card-header h2 { font-size: 14px; margin-bottom: 4px; }
  .card-header p  { font-size: 11px; line-height: 1.45; word-break: break-word; overflow-wrap: anywhere; }

  .left-card-header { flex-direction: column; gap: 6px; }
  .reset-btn { align-self: flex-start; }

  .field-label { font-size: 11px; margin-bottom: 6px; }
  .input-control { flex: 1 1 auto; width: 100%; }
  input[type="number"] { height: 38px; font-size: 13px; padding: 0 46px 0 8px; }
  .number-stepper {
    width: 38px;
  }
  .stepper-btn {
    width: 36px;
    height: 18px;
  }
  .stepper-btn::before {
    border-left-width: 4px;
    border-right-width: 4px;
  }
  .stepper-btn:first-child::before {
    border-bottom-width: 5px;
  }
  .stepper-btn:last-child::before {
    border-top-width: 5px;
  }
  .ghost-btn { height: 30px; font-size: 11px; padding: 0 8px; }

  .status-bar { flex-direction: column; align-items: flex-start; margin: 10px 0 8px; gap: 5px; }
  .status-chip { font-size: 11px; padding: 4px 8px; }
  .hint { font-size: 11px; word-break: break-word; overflow-wrap: anywhere; }
  .message { font-size: 12px; }

  .value-grid { gap: 5px; margin-top: 8px; }
  .value-box { padding: 8px 4px; border-radius: 6px; }
  .value-box .label { font-size: 9px; margin-bottom: 4px; }
  .value-box .num {
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .choice-area { gap: 6px; margin-top: 10px; }
  .choice-btn { height: 34px; padding: 0 10px; }
  .choice-btn strong { font-size: 12px; }

  .sens-table { font-size: 11px; }
  .sens-table th { font-size: 11px; padding: 0 0 8px; }
  .sens-table th:last-child, .sens-table td:last-child { padding-right: 2px; }
  .sens-table td { padding: 7px 0; word-break: break-all; }
  .final-result .big-val { font-size: 18px; }
  .final-result .desc    { font-size: 11px; word-break: break-word; }
}
