@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap');

:root {
  --ink: #1d292b;
  --muted: #728080;
  --paper: #f8f6f1;
  --paper-deep: #eeece5;
  --line: #deded6;
  --orange: #ee7252;
  --orange-deep: #d95a3c;
  --orange-soft: #fae7df;
  --teal: #39a59b;
  --teal-deep: #218a82;
  --teal-soft: #dcefe9;
  --yellow: #f4c45e;
  --shadow: 0 18px 50px rgba(24, 42, 40, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: 'DM Sans', system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 32px 38px 30px; }

.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 15px; letter-spacing: -.02em; }
.brand b { font-weight: 700; }
.brand-mark { width: 29px; height: 29px; padding: 7px 6px; display: flex; align-items: flex-end; gap: 3px; border-radius: 9px; background: var(--ink); }
.brand-mark span { flex: 1; border-radius: 2px 2px 1px 1px; background: var(--orange); }
.brand-mark span:nth-child(1) { height: 8px; }.brand-mark span:nth-child(2) { height: 13px; background: var(--yellow); }.brand-mark span:nth-child(3) { height: 17px; background: var(--teal); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.ready-pill { padding: 7px 12px; border: 1px solid #d7ddd7; border-radius: 100px; color: var(--teal-deep); background: #f3f8f4; font: 500 10px 'DM Mono', monospace; letter-spacing: .05em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(57, 165, 155, .15); }
.icon-button, .close-button { border: 0; background: transparent; color: var(--ink); }
.icon-button { width: 34px; height: 34px; padding: 8px; border-radius: 50%; transition: background .2s, transform .2s; }
.icon-button:hover { background: var(--paper-deep); transform: rotate(18deg); }
.icon-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.hero { min-height: 256px; padding: 54px 0 42px; display: flex; justify-content: space-between; align-items: flex-end; }
.eyebrow, .section-kicker { color: var(--orange-deep); font: 500 10px 'DM Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; }
.eyebrow-line { width: 22px; height: 1px; background: var(--orange); }
h1, h2, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(42px, 6vw, 68px); font-weight: 600; line-height: .96; letter-spacing: -.065em; }
h1 em { color: var(--orange); font-family: Fraunces, Georgia, serif; font-weight: 500; letter-spacing: -.07em; }
.hero-description { max-width: 405px; margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.hero-note { display: flex; align-items: center; gap: 11px; padding: 11px 0 3px; border-top: 1px solid var(--line); min-width: 180px; }
.note-number { color: var(--teal-deep); font: 500 30px 'DM Mono', monospace; letter-spacing: -.08em; }.note-label { color: var(--muted); font: 10px/1.25 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .06em; }

.workspace { display: grid; grid-template-columns: minmax(290px, 380px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.control-panel, .output-panel { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.36); box-shadow: var(--shadow); }
.control-panel { overflow: hidden; }
.control-section { padding: 25px 25px 21px; }
.control-section + .control-section { border-top: 1px solid var(--line); }
.control-heading, .output-topline, .output-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; }
.control-heading { margin-bottom: 18px; }
h2 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.035em; }.selection-label { align-self: center; padding: 6px 8px; border-radius: 5px; background: var(--orange-soft); color: var(--orange-deep); font: 500 10px 'DM Mono', monospace; white-space: nowrap; }.count-label { background: var(--teal-soft); color: var(--teal-deep); }
.option-grid { display: grid; gap: 7px; }.word-grid { grid-template-columns: repeat(4, 1fr); }.count-grid { grid-template-columns: repeat(5, 1fr); }
.choice { position: relative; min-width: 0; }.choice input { position: absolute; opacity: 0; pointer-events: none; }.choice label { display: flex; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font: 500 12px 'DM Mono', monospace; transition: color .18s, background .18s, border-color .18s, transform .18s; user-select: none; }.choice label:hover { border-color: #afb8b1; transform: translateY(-1px); }.choice input:checked + label { border-color: var(--orange); background: var(--orange); color: white; box-shadow: 0 4px 10px rgba(238,114,82,.21); }.count-grid .choice input:checked + label { border-color: var(--teal); background: var(--teal); box-shadow: 0 4px 10px rgba(57,165,155,.22); }.choice.random label { gap: 5px; color: var(--teal-deep); border-color: #b7d9d2; background: var(--teal-soft); }.choice.random input:checked + label { background: var(--teal-deep); border-color: var(--teal-deep); color: white; }.random-spark { font-size: 14px; line-height: 0; }
.control-hint { margin: 15px 0 0; color: var(--muted); font-size: 11px; }.hint-icon { display: inline-block; margin-right: 5px; color: var(--teal-deep); font-size: 14px; }

.output-panel { padding: 25px; display: flex; flex-direction: column; min-width: 0; }.output-topline { align-items: center; margin-bottom: 16px; }.secondary-button, .copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; border-radius: 10px; font-size: 13px; font-weight: 700; transition: transform .18s, background .18s, box-shadow .18s; }.secondary-button { width: stretch; padding: 13px 19px; border: 1px solid var(--orange); background: var(--orange-soft); color: var(--orange-deep); }.secondary-button:hover { background: var(--orange); color: white; box-shadow: 0 8px 18px rgba(238,114,82,.25); transform: translateY(-1px); }.secondary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.inline-setting { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font: 10px 'DM Mono', monospace; white-space: nowrap; }
.output-box { height: 365px; overflow-y: auto; padding: 21px 22px; border: 1px solid #d9ddd5; border-radius: 10px; background: #fffefa; color: #334142; font-size: 14px; line-height: 1.72; scrollbar-color: #b6c4bd transparent; scrollbar-width: thin; }.output-box:focus { outline: 2px solid rgba(57,165,155,.35); outline-offset: 2px; }.output-box p { margin: 0 0 20px; }.output-box p:last-child { margin-bottom: 0; }.output-box::selection { background: var(--orange-soft); }
.output-footer { padding-top: 17px; }.stats { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 10px 'DM Mono', monospace; }.stats strong { color: var(--ink); font-weight: 500; }.stat-divider { width: 3px; height: 3px; border-radius: 50%; background: #b8c1bb; }.copy-button { width: stretch; padding: 13px 20px; border: 1px solid var(--teal-deep); background: var(--teal-deep); color: white; }.copy-button:hover { background: #176f69; box-shadow: 0 8px 18px rgba(33,138,130,.25); transform: translateY(-1px); }.copy-button.copied { border-color: #16845a; background: #16845a; box-shadow: 0 8px 20px rgba(22,132,90,.3); }.copy-button.copied svg { display: none; }.copy-button.copied::before { content: '✓'; font-size: 17px; line-height: 1; }.copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tip-card { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 17px 20px; border: 1px solid #e3d8b5; border-radius: 11px; background: #fff8e7; }.tip-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: var(--yellow); color: #7f5b1e; font-size: 16px; }.tip-card p { margin: 5px 0 0; color: #746642; font-size: 12px; }.tip-shortcut { margin-left: auto; color: #9a885b; font: 10px 'DM Mono', monospace; }.tip-shortcut kbd { padding: 3px 5px; border: 1px solid #dfcd9e; border-bottom-width: 2px; border-radius: 3px; background: #fffdf4; font-size: 10px; }
.footer { display: flex; justify-content: flex-end; padding: 29px 2px 0; color: #9aa3a0; font: 10px 'DM Mono', monospace; letter-spacing: .03em; }.github-link { color: var(--teal-deep); text-decoration: none; }.github-link:hover { text-decoration: underline; }

.settings-backdrop { position: fixed; inset: 0; z-index: 4; background: rgba(21,32,32,.2); backdrop-filter: blur(3px); }.settings-drawer { position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: min(365px, 100%); padding: 31px 28px; background: var(--paper); box-shadow: -20px 0 55px rgba(20, 35, 34, .14); transform: translateX(105%); transition: transform .3s ease; }.settings-drawer.open { transform: translateX(0); }.drawer-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 25px; border-bottom: 1px solid var(--line); }.close-button { width: 30px; height: 30px; font-size: 28px; line-height: 1; color: var(--muted); }.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 21px 0; border-bottom: 1px solid var(--line); }.setting-row strong, .setting-row span { display: block; }.setting-row strong { font-size: 13px; }.setting-row div > span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }.switch input { position: absolute; opacity: 0; }.switch span { position: absolute; inset: 0; border-radius: 20px; background: #c7d0ca; transition: background .2s; }.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }.switch input:checked + span { background: var(--teal); }.switch input:checked + span::after { transform: translateX(18px); }.drawer-note { margin-top: 25px; color: var(--muted); font: 10px/1.6 'DM Mono', monospace; }
.toast { position: fixed; z-index: 10; bottom: 28px; left: 50%; padding: 11px 15px; border-radius: 7px; background: var(--ink); color: white; font-size: 12px; box-shadow: 0 8px 30px rgba(29,41,43,.2); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 780px) { .page-shell { padding: 24px 20px 25px; }.workspace { grid-template-columns: 1fr; }.control-panel { display: grid; grid-template-columns: 1fr 1fr; }.control-section + .control-section { border-top: 0; border-left: 1px solid var(--line); }.output-box { height: 330px; } }
@media (max-width: 570px) { .control-panel { display: block; }.control-section + .control-section { border-top: 1px solid var(--line); border-left: 0; }.output-panel { padding: 20px 16px 17px; }.output-box { height: 360px; padding: 18px; font-size: 13px; }.output-topline { align-items: flex-start; }.inline-setting { gap: 7px; white-space: normal; text-align: right; }.output-footer { align-items: stretch; flex-direction: column; gap: 13px; }.copy-button, .secondary-button { width: 100%; }.stats { flex-wrap: wrap; }.footer { padding-top: 23px; } }
