@font-face {
  font-family: 'Barlow Condensed';
  src: url('assets/barlow-semibold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #081626;
  --surface: rgba(11, 29, 49, .88);
  --field: #08192b;
  --text: #f0f5fc;
  --muted: #b5c5d7;
  --line: #55788f;
  --yellow: #f2cf70;
  --cyan: #85dfed;
  --error: #ffadb0;
  --button-cut: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  color: var(--text);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-synthesis: none;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--page);
  background-image: linear-gradient(180deg, #0412250d, #04122533), url('assets/anime-world-v1.png');
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--yellow); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, summary, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border-radius: 1px; transition: background-color .15s, color .15s, border-color .15s, transform .15s; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:not(:disabled):hover { transform: translateY(-1px); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 2px; border-color: var(--cyan); }
svg { display: block; flex: none; }
.button-icon, button svg { width: 16px; height: 16px; }
.button-icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
section[id], article[id], aside[id] { scroll-margin-top: 24px; }
.page-width { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }
.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; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 12px 18px; color: #102035; background: var(--yellow); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* The emblem, tabs and corner marks share the same gold/cyan language. */
.site-header { border-top: 2px solid #bda358; border-bottom: 1px solid #66bfd14f; background: rgba(6, 21, 38, .94); }
.header-inner { width: min(1040px, calc(100% - 48px)); min-height: 74px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: #f6f8ff; text-decoration: none; white-space: nowrap; }
.brand-emblem, .wordmark .brand-emblem { width: 44px; height: 44px; color: var(--yellow); }
.brand-type { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif; font-size: 28px; font-weight: 600; line-height: .95; letter-spacing: 1.2px; }
.brand-subtitle { color: #9cdae4; font-size: 8px; font-weight: 600; line-height: 1; letter-spacing: 1.7px; }
.wordmark-mark { color: var(--yellow); font-family: 'Barlow Condensed', Arial, sans-serif; font-size: 30px; font-weight: 600; }
.header-inner nav { display: flex; align-items: center; gap: 29px; }
.header-inner nav a { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; color: #c1d0e2; font-size: 13px; text-decoration: none; }
.header-inner nav a:hover, .header-inner nav .nav-active { color: #f8df9e; }
.header-inner nav .nav-active::after { position: absolute; right: 0; bottom: 3px; left: 0; height: 1px; background: #d1b365; content: ''; }
.count-badge { min-width: 19px; padding: 1px 5px; border: 1px solid #59778f; color: #cce9f5; background: #17354a; text-align: center; font-size: 11px; line-height: 1.4; }

/* Keep the character artwork clear on the right and the title legible on the left. */
.page-intro.game-hero { position: relative; isolation: isolate; height: 230px; margin: 28px 0 0; padding: 0; overflow: hidden; border: 1px solid #7893a5; background: #10253a; }
.hero-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.game-hero::before { position: absolute; inset: 0; z-index: -1; content: ''; background: linear-gradient(90deg, #07172bf2 0%, #081a2ce6 30%, #0b1b2d68 60%, #0b1b2d05 87%); }
.game-hero::after { position: absolute; top: 13px; left: 13px; width: 23px; height: 14px; border-top: 2px solid #f1d48b; border-left: 2px solid #f1d48b; content: ''; pointer-events: none; }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; width: 68%; max-width: 650px; height: 100%; padding: 25px 32px; }
.breadcrumb { margin: 0 0 12px; color: #bdcde0; font-size: 11px; }
.breadcrumb span { margin-inline: 4px; color: #8cd9e6; }
.breadcrumb a { text-decoration: none; }
.game-hero h1 { margin: 0 0 10px; color: #f6f9ff; font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif; font-size: 49px; font-weight: 600; line-height: 1; letter-spacing: .6px; text-transform: uppercase; }
.game-hero .hero-copy > p:not(.breadcrumb):not(.hero-meta) { max-width: 405px; margin: 0; color: #d4e0ef; font-size: 14px; line-height: 1.6; }
.hero-meta { margin-top: 15px; color: var(--yellow); font-size: 11px; font-weight: 600; letter-spacing: .5px; }
.noscript-notice { padding: 15px 18px; margin-bottom: 20px; border: 1px solid #c4a761; color: #f8df9f; background: #17283be8; font-size: 14px; }

.game-shortcuts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; max-width: 100%; margin: 0 0 20px; border: 1px solid #67869b; border-top: 0; background: rgba(8, 26, 44, .92); }
.game-shortcuts button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 84px; padding: 10px 13px; border: 0; border-right: 1px solid #54728680; border-radius: 0; color: #c9d8e9; background: transparent; font-size: 13px; font-weight: 600; white-space: nowrap; }
.game-shortcuts [data-game='cs2'] { --faction: #f1ce83; }
.game-shortcuts [data-game='fortnite'] { --faction: #a4e3f2; }
.game-shortcuts [data-game='apex'] { --faction: #f4b299; }
.game-shortcuts [data-game='overwatch'] { --faction: #f7d4a5; }
.game-shortcuts button:last-child { border-right: 0; }
.game-shortcuts button::before { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-top: 1px solid #89c6da77; border-right: 1px solid #89c6da77; content: ''; }
.game-shortcuts button:hover { color: #fff; background: #25445c9c; }
.game-shortcuts button[aria-pressed='true'] { color: #fff0c6; background: #24435bd1; }
.game-shortcuts button[aria-pressed='true']::after { position: absolute; right: 14px; bottom: 0; left: 14px; height: 2px; content: ''; background: var(--yellow); }
.game-shortcuts button:focus-visible { outline-offset: -5px; }
.game-logo { display: flex; align-items: center; justify-content: center; width: 100px; height: 32px; flex: none; }
.game-logo img { display: block; max-width: 100%; max-height: 30px; object-fit: contain; }

/* Opaque input fields sit on lightly translucent instrument panels. */
.tool-board { position: relative; border: 1px solid #7295ad; background: transparent; }
.tool-board::before, .tool-board::after { position: absolute; z-index: 2; width: 24px; height: 11px; content: ''; pointer-events: none; }
.tool-board::before { top: -1px; left: -1px; border-top: 2px solid var(--yellow); border-left: 2px solid var(--yellow); }
.tool-board::after { right: -1px; bottom: -1px; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); }
.tool-topline { border-bottom: 1px solid #64869e; background: rgba(9, 28, 49, .94); }
.mode-switch { display: flex; gap: 2px; padding: 0 2px 0 0; }
.mode-switch button { position: relative; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 52px; padding: 12px 24px; border: 0; border-right: 1px solid #6a93ac80; border-radius: 0; color: #d1dfed; background: #102b43; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); font-size: 13px; font-weight: 600; }
.mode-switch button svg { width: 16px; height: 16px; }
.mode-switch button:hover { color: #fff; background: #20445d; }
.mode-switch button[aria-pressed='true'] { color: #ffdfa0; background: #294252; }
.mode-switch button[aria-pressed='true']::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--yellow); content: ''; }
.mode-switch button:focus-visible { outline-offset: -5px; }
.calculator-grid { display: grid; grid-template-columns: 1.15fr 1fr; }
.calculator-inputs { min-width: 0; padding: 24px 25px 15px; background: var(--surface); }
.settings-row, .numbers-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 18px; }
.settings-row { margin-bottom: 18px; }
.field { min-width: 0; }
label, .field-label, .control-label { display: block; margin: 0 0 8px; color: #eaf2fc; font-size: 14px; font-weight: 600; line-height: 1.3; }
input, select, textarea { display: block; width: 100%; min-width: 0; border: 1px solid #7896ae; border-radius: 1px; color: #f5f9ff; background-color: var(--field); }
input, select { min-height: 47px; padding: 10px 12px; }
input { background-image: linear-gradient(135deg, transparent 45%, #87bfd19c 46%, #87bfd19c 55%, transparent 56%); background-repeat: no-repeat; background-position: right bottom; background-size: 8px 8px; font-size: 18px; font-variant-numeric: tabular-nums; }
select { font-size: 14px; }
input:hover, select:hover, textarea:hover { border-color: #b0d8e8; }
input::placeholder, textarea::placeholder { color: #b0c1d2; opacity: 1; font-size: 13px; }
input[aria-invalid='true'] { border-color: var(--error); }
.field-hint, #format-hint, #game-note { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
#format-hint { margin-top: 11px; }
.field-error, .form-error { margin: 6px 0 0; color: var(--error); font-size: 12px; line-height: 1.5; }
.field-error:empty, .form-error:empty { display: none; }
.format-switch { display: flex; width: 100%; min-height: 47px; border: 1px solid #7896ae; border-radius: 1px; }
.format-switch button { flex: 1; min-height: 45px; padding: 9px 8px; border: 0; border-radius: 0; color: #c7d7e8; background: #0c2137; font-size: 12px; font-weight: 600; white-space: nowrap; }
.format-switch button + button { border-left: 1px solid #7896ae; }
.format-switch button[aria-pressed='true'] { color: #f6dc9d; background: #334547; box-shadow: inset 0 -2px #c9b16e; }
.format-switch button:hover { background: #29465a; }
.format-switch button:focus-visible { outline-offset: -4px; }
.dpi-presets { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 6px; margin-top: 8px; }
.dpi-presets > span { display: none; }
.dpi-presets button { flex: 1; min-width: 44px; min-height: 44px; padding: 6px 4px; border: 1px solid #60849d; color: #cee4f3; background: #143047; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%); font-size: 12px; }
.dpi-presets button:hover { background: #284e65; color: #fff; }
.dpi-presets button[aria-pressed='true'] { color: #ffe3a5; border-color: #c4ac6a; background: #334744; }
.dpi-presets button:focus-visible { outline-offset: -4px; }
.advanced-settings { margin-top: 17px; border-top: 1px solid #55768e; border-bottom: 1px solid #55768e; }
.advanced-settings summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 45px; list-style: none; cursor: pointer; color: #d2e7f4; font-size: 13px; }
.advanced-settings summary::-webkit-details-marker, .faq-list summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after, .faq-list summary::after { content: '+'; flex: none; color: var(--cyan); font-size: 19px; line-height: 1; }
.advanced-settings[open] summary::after, .faq-list details[open] summary::after { content: '−'; }
.optional-label { margin-left: auto; color: #b1c6d7; font-size: 12px; font-weight: 400; }
.advanced-body { padding: 7px 0 17px; }
.advanced-body input { font-size: 16px; }
.form-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 18px; margin-top: 12px; }
#form-error { margin: 4px 0; }
.text-button, .reset-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 1px solid #587c96; color: #cce4f5; background: #142e45; clip-path: var(--button-cut); font-size: 12px; }
.text-button:hover, .reset-button:hover { color: #f4d99b; border-color: #cab16a; background: #254558; }
.text-button:focus-visible, .reset-button:focus-visible { outline-offset: -5px; }
.reset-button { margin-left: auto; }

.result-panel { display: flex; flex-direction: column; min-width: 0; padding: 24px 29px 23px; border-left: 1px solid #6489a0; background: rgba(7, 22, 42, .9); }
.result-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 21px; color: #abcbdc; font-size: 12px; }
.result-topline > span:first-child { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
#game-summary { padding: 3px 8px; border-right: 2px solid #78ccdd; color: #d4e9f6; background: #183a53; overflow-wrap: anywhere; }
.result-label { margin: 0 0 5px; padding-left: 8px; border-left: 2px solid var(--yellow); color: #cedeea; font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.result-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; line-height: 1.1; }
.result-number output { display: block; max-width: 100%; color: #f7d67e; font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif; font-size: 66px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-shadow: 0 1px 12px #f2c56814; }
.result-number > span { color: #d9e5f1; font-size: 16px; }
.result-formula { margin: 11px 0 6px; color: #e3edf9; font-family: Consolas, 'Courier New', monospace; font-size: 13px; overflow-wrap: anywhere; }
.result-subtitle { margin: 0; color: #b7c9dc; font-size: 12px; line-height: 1.6; }
.result-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 19px; margin-top: 22px; padding: 16px 0 15px; border-top: 1px solid #496f8b; border-bottom: 1px solid #496f8b; }
.result-stats > div + div { padding-left: 20px; border-left: 1px solid #496f8b; }
.stat-label { display: block; color: #b7d0e2; font-size: 12px; line-height: 1.5; }
.result-stats p { margin: 5px 0 3px; color: #f0f7ff; font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#distance-unit { color: #c3dced; font-size: 12px; }
.stat-hint { display: block; color: #b0c6da; font-size: 12px; line-height: 1.5; }
.precision-note { margin: 13px 0 0; color: #adc4d8; font-size: 12px; line-height: 1.6; }
.conversion-note { margin: 13px 0 0; padding: 10px 0; color: #e7d3a0; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.result-actions { margin-top: auto; padding-top: 20px; }
.primary-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 18px; border: 1px solid #efda9d; color: #182539; background: linear-gradient(180deg, #f5d789, #dfb654); box-shadow: inset 0 1px #fff0c6, inset 0 -2px #9c7732; clip-path: var(--button-cut); font-size: 13px; font-weight: 700; letter-spacing: .2px; }
.primary-button::before { position: absolute; top: 5px; left: 9px; width: 21px; height: 1px; background: #fff4cf; content: ''; }
.primary-button::after { position: absolute; right: 9px; bottom: 5px; width: 21px; height: 1px; background: #765e3199; content: ''; }
.primary-button:hover { color: #122137; background: linear-gradient(180deg, #ffe9ad, #f0ca6d); }
.primary-button:focus-visible { outline-color: #112a47; outline-offset: -5px; }
.result-actions > .primary-button { width: 100%; }
.secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 9px; }
.secondary-actions button, .outline-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 12px; border: 1px solid #759cb6; color: #d7edf9; background: #15364b; clip-path: var(--button-cut); font-size: 12px; }
.secondary-actions button::after, .outline-button::after { position: absolute; right: 7px; bottom: 4px; width: 15px; height: 1px; background: #9cd8e5; content: ''; }
.secondary-actions button:hover, .outline-button:hover { border-color: #bbebf3; color: #fff; background: #2b5369; }
.secondary-actions button:focus-visible, .outline-button:focus-visible { outline-offset: -5px; }
.tool-footnote { padding: 12px 24px; border-top: 1px solid #5d8199; color: #bad0e3; background: rgba(13, 35, 57, .93); }
.tool-footnote #game-note { margin: 0; font-size: 12px; }

/* Reference material uses the same instrument framing without competing with the result. */
.information-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin: 27px 0 23px; }
h2, h3 { color: #f0f6ff; }
h2 { font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif; font-size: 27px; font-weight: 600; line-height: 1.25; letter-spacing: .2px; }
h3 { font-size: 16px; line-height: 1.4; }
.guide-copy, .saved-section, .faq-section { min-width: 0; border: 1px solid #557b93; background: rgba(9, 28, 49, .88); }
.guide-copy { padding: 23px 25px; }
.guide-copy h2, .section-heading h2, .faq-section > h2 { position: relative; padding-left: 12px; }
.guide-copy h2::before, .section-heading h2::before, .faq-section > h2::before { position: absolute; top: 5px; bottom: 3px; left: 0; width: 3px; background: #d9bd76; content: ''; }
.guide-copy h2 { margin: 0 0 15px; }
.guide-copy h3 { margin: 25px 0 9px; color: #dfebf9; }
.guide-copy p { margin: 0 0 14px; color: #bed0e2; font-size: 14px; line-height: 1.75; }
.guide-copy p:last-child { margin-bottom: 0; }
.guide-copy strong { color: #f0ead7; font-weight: 600; }
.guide-copy a, .faq-list a { color: #f0d89b; }
.guide-copy .source-note { color: #b3c9dd; font-size: 12px; }
.formula-box { display: block; margin: 16px 0; padding: 12px 15px; border: 1px solid #537c96; border-left: 3px solid #d7bd7b; color: #e9e6d6; background: #13334ae8; font-family: Consolas, 'Courier New', monospace; font-size: 13px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.example-table { width: 100%; border-collapse: collapse; margin: 18px 0; text-align: left; color: #cedff0; font-size: 13px; font-variant-numeric: tabular-nums; }
.example-table th, .example-table td { padding: 10px 11px; border-bottom: 1px solid #4c738d; }
.example-table th:first-child, .example-table td:first-child { padding-left: 10px; }
.example-table thead th { color: #f0d79a; background: #234257b5; font-size: 12px; font-weight: 600; border-bottom-color: #8f9c8f; }
.example-table tbody th { font-weight: 400; color: #cbdff0; }
.example-table tbody tr:last-child th, .example-table tbody tr:last-child td { color: #f0d38e; background: #253d44a6; }
.saved-section { padding: 23px 21px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.section-heading h2 { margin: 0; }
.local-label { display: inline-flex; align-items: center; gap: 6px; color: #b4ccde; font-size: 12px; }
.saved-empty { padding: 1px 0 0; color: #bbd1e4; }
.saved-empty p { margin: 0 0 9px; font-size: 13px; line-height: 1.75; }
.saved-list:empty { display: none; }
.saved-card { min-width: 0; padding: 17px 0; border-bottom: 1px solid #4b7893; }
.saved-card:first-child { padding-top: 4px; }
.saved-game { color: #8fd8e7; font-size: 12px; }
.saved-card h3 { margin: 5px 0 7px; font-size: 16px; overflow-wrap: anywhere; }
.saved-detail { margin: 0 0 10px; color: #bfd2e6; font-size: 12px; overflow-wrap: anywhere; }
.saved-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-actions button { min-height: 44px; padding: 7px 12px; border: 1px solid #779cb7; color: #d5ecfa; background: #15354a; clip-path: var(--button-cut); font-size: 12px; }
.saved-actions button:hover { border-color: #b2dce9; background: #285269; }
.saved-actions button:focus-visible { outline-offset: -5px; }
.saved-actions .saved-delete { color: #c9d8e7; border-color: #58768c; background: #172a40; }
.faq-section { margin: 0 0 28px; padding: 23px 25px 15px; }
.faq-section > h2 { margin: 0 0 11px; }
.faq-list details { border-bottom: 1px solid #4e728d; }
.faq-list details:last-child { border-bottom: 0; }
.faq-list details[open] { background: #16364d8f; }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; min-height: 53px; gap: 20px; padding: 11px 0; color: #e3eef9; font-size: 14px; list-style: none; cursor: pointer; }
.faq-list summary:hover { color: #f1d68c; }
.faq-list details[open] summary { color: #f1d68c; }
.faq-list p { max-width: 850px; margin: 0 29px 17px 0; color: #bfd3e6; font-size: 13px; line-height: 1.85; }
.site-footer { padding: 23px 0 27px; border-top: 1px solid #507890; background: rgba(5, 21, 39, .93); }
.footer-inner { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }
.site-footer p { max-width: 960px; margin: 0 0 9px; color: #b5cadd; font-size: 12px; line-height: 1.85; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer a { color: #e6d59f; }
.site-footer strong { color: #e8d194; }

.app-dialog { width: min(450px, calc(100% - 32px)); padding: 27px; border: 1px solid #9abaac; border-top: 3px solid #dfc178; border-radius: 1px; color: #eff6ff; background: #102a43; }
.app-dialog::backdrop { background: #021024c7; }
.app-dialog h2 { margin: 0 0 12px; color: #f4dfab; font-size: 28px; }
.dialog-description { margin: 0 0 23px; color: #bed5e8; font-size: 13px; line-height: 1.75; }
.app-dialog input { font-size: 16px; }
.app-dialog textarea { min-height: 116px; resize: vertical; padding: 11px 12px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.toast { position: fixed; bottom: 20px; left: 50%; z-index: 90; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 12px 18px; border: 1px solid #f4dfab; border-left: 4px solid #d0a849; color: #152b41; background: #f1d48a; font-size: 13px; line-height: 1.65; text-align: center; overflow-wrap: anywhere; opacity: 0; visibility: hidden; pointer-events: none; }
.toast.visible { opacity: 1; visibility: visible; }

@media (max-width: 900px) {
  body { background-position: left center; }
  .header-inner nav { gap: 21px; }
  .hero-copy { width: 73%; padding-left: 27px; }
  .game-shortcuts button { gap: 7px; padding-inline: 8px; font-size: 12px; }
  .calculator-inputs { padding: 22px 20px 14px; }
  .settings-row, .numbers-grid { gap: 16px 12px; }
  .result-panel { padding-inline: 22px; }
  .format-switch button { padding-inline: 5px; font-size: 11px; }
  .dpi-presets { grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 5px; }
  .dpi-presets button { min-width: 44px; font-size: 11px; }
  .result-stats { gap: 12px; }
  .result-stats > div + div { padding-left: 13px; }
  .information-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 19px; }
  .guide-copy, .faq-section { padding-inline: 21px; }
  .saved-section { padding-inline: 19px; }
}

@media (max-width: 800px) {
  .game-shortcuts { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #94b0ba #142e45; }
  .game-shortcuts button { flex: 1 0 auto; min-width: 112px; padding-inline: 12px; }
  .game-shortcuts::-webkit-scrollbar { height: 5px; }
  .game-shortcuts::-webkit-scrollbar-track { background: #142e45; }
  .game-shortcuts::-webkit-scrollbar-thumb { background: #94b0ba; }
}

@media (max-width: 700px) {
  body { background-position: 8% center; }
  .page-width, .header-inner, .footer-inner { width: calc(100% - 32px); }
  .header-inner { min-height: 70px; gap: 16px; }
  .brand-emblem, .wordmark .brand-emblem { width: 40px; height: 40px; }
  .brand-name { font-size: 26px; }
  .brand-subtitle { font-size: 8px; letter-spacing: 1.7px; }
  .header-inner nav { gap: 17px; }
  .header-inner nav a { font-size: 12px; }
  .header-inner nav a:nth-child(2) { display: none; }
  .page-intro.game-hero { height: 210px; margin-top: 21px; }
  .hero-copy { width: 78%; padding: 20px 23px; }
  .game-hero h1 { font-size: 43px; }
  .breadcrumb { margin-bottom: 10px; }
  .game-hero .hero-copy > p:not(.breadcrumb):not(.hero-meta) { max-width: 330px; font-size: 13px; }
  .game-hero::before { background: linear-gradient(90deg, #07172bf5 0%, #081a2ce8 35%, #0b1b2d88 70%, #0b1b2d28 100%); }
  .game-shortcuts { margin-bottom: 17px; }
  .game-shortcuts button { min-height: 84px; gap: 6px; }
  .mode-switch { gap: 1px; padding-right: 0; }
  .mode-switch button { flex: 1; padding: 11px 8px; font-size: 12px; gap: 5px; }
  .mode-switch button:last-child { border-right: 0; }
  .calculator-grid { grid-template-columns: 1fr; }
  .calculator-inputs { padding: 23px 22px 16px; }
  .settings-row, .numbers-grid { gap: 17px 20px; }
  .format-switch button { font-size: 12px; }
  .dpi-presets { grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 6px; }
  .dpi-presets button { min-width: 44px; font-size: 12px; }
  .result-panel { padding: 23px 24px 25px; border-left: 0; border-top: 1px solid #749eb3; }
  .result-topline { margin-bottom: 16px; }
  .result-number output { font-size: 62px; }
  .result-stats { margin-top: 19px; }
  .result-stats > div + div { padding-left: 23px; }
  .tool-footnote { padding: 12px 22px; }
  .information-grid { grid-template-columns: 1fr; gap: 19px; margin-top: 23px; }
  .guide-copy, .saved-section, .faq-section { padding: 22px; }
  .saved-empty p:last-child { margin-bottom: 0; }
  .faq-section { margin-bottom: 23px; padding-bottom: 14px; }
  .faq-list summary { font-size: 13px; }
}

@media (max-width: 420px) {
  .header-inner { gap: 12px; }
  .wordmark { gap: 8px; }
  .brand-emblem, .wordmark .brand-emblem { width: 38px; height: 38px; }
  .brand-name { font-size: 25px; }
  .brand-subtitle { letter-spacing: 1.5px; }
  .header-inner nav { gap: 12px; }
  .header-inner nav a { font-size: 11px; }
  .header-inner nav a:first-child { display: none; }
  .page-intro.game-hero { height: 190px; margin-top: 17px; }
  .hero-copy { width: 92%; padding: 18px; }
  .game-hero h1 { margin-bottom: 10px; font-size: 39px; }
  .breadcrumb { font-size: 10px; }
  .game-hero .hero-copy > p:not(.breadcrumb):not(.hero-meta) { max-width: 260px; font-size: 12px; line-height: 1.65; }
  .hero-art { opacity: .87; object-position: 58% center; }
  .game-hero::before { background: linear-gradient(90deg, #07172bf5 0%, #081a2ce0 39%, #0b1b2d88 78%, #0b1b2d45 100%); }
  .game-shortcuts button { min-width: 112px; min-height: 84px; }
  .mode-switch button { min-height: 52px; font-size: 11px; padding: 11px 6px; }
  .mode-switch button svg { width: 14px; height: 14px; }
  .calculator-inputs { padding: 21px 17px 16px; }
  .settings-row, .numbers-grid { gap: 17px 12px; }
  select { padding-left: 9px; font-size: 12px; }
  input { font-size: 17px; padding-inline: 10px; }
  .format-switch button { padding-inline: 4px; font-size: 11px; }
  .dpi-presets { gap: 4px; }
  .dpi-presets button { min-width: 44px; font-size: 11px; }
  .result-panel { padding-inline: 20px; }
  .result-number output { font-size: 60px; }
  .result-number > span { font-size: 14px; }
  .result-stats > div + div { padding-left: 15px; }
  .result-stats p { font-size: 20px; }
  .tool-footnote { padding-inline: 17px; }
  .guide-copy, .saved-section, .faq-section { padding-inline: 18px; }
  .formula-box { font-size: 12px; padding: 11px 12px; }
  .example-table { font-size: 12px; }
  .example-table th, .example-table td { padding-inline: 8px; }
  .app-dialog { padding: 23px; }
  .app-dialog input { font-size: 16px; }
}

@media (max-width: 350px) {
  .page-width, .header-inner, .footer-inner { width: calc(100% - 24px); }
  .game-hero h1 { font-size: 35px; }
  .hero-copy { width: 100%; padding-inline: 15px; }
  .game-hero .hero-copy > p:not(.breadcrumb):not(.hero-meta) { max-width: 246px; }
  .mode-switch button { font-size: 10px; padding-inline: 5px; gap: 4px; }
  .mode-switch button svg { width: 13px; height: 13px; }
  .calculator-inputs { padding-inline: 13px; }
  .settings-row, .numbers-grid { grid-template-columns: 1fr; gap: 16px; }
  .dpi-presets { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .dpi-presets button { min-width: 44px; }
  .result-panel { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  button { transition: none; }
  button:not(:disabled):hover { transform: none; }
}
