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

:root {
  font-family: 'DM Sans', Arial, sans-serif;
  color: #19221c;
  background: #f5f3ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #19221c;
  --muted: #68716b;
  --green: #c8f36a;
  --line: #dcded7;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.topbar { min-height: 82px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 800; letter-spacing: .11em; }
.install-button { margin-left: auto; }
.auth-button, .install-button { min-height: 36px; }
.account-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0 0; padding: 15px 18px; border: 1px solid #cbdba8; border-radius: 10px; background: #edf5dc; font: 500 11px 'DM Mono', monospace; }
.account-summary[hidden] { display: none; }
.account-email { min-width: 0; overflow-wrap: anywhere; color: #566253; }
.account-email strong { color: var(--ink); }
.account-credit-total { display: flex; align-items: baseline; gap: 8px; margin-left: auto; color: #526a35; white-space: nowrap; }
.account-credit-total strong { color: var(--ink); font-family: 'DM Sans', Arial, sans-serif; font-size: 24px; font-weight: 800; }
.account-summary button { min-height: 35px; }
.credits-card { display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; padding: 16px; border: 1px solid #dce4cf; border-radius: 10px; background: #f4f8ed; font-size: 13px; }
.credits-card span, .credits-card small { color: var(--muted); }
.buy-button { align-self: flex-start; padding: 11px 14px; border: 0; border-radius: 7px; background: var(--green); color: var(--ink); font: 500 11px 'DM Mono', monospace; text-decoration: none; cursor: pointer; }
.buy-button:hover { background: #b7e650; }
.buy-button:disabled { opacity: .65; cursor: wait; }
.final-sale-notice { margin: 3px 0 0; color: #6d3026; font-size: 12px; font-weight: 700; line-height: 1.45; }
.purchase-consent { display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 4px; color: var(--ink); font-size: 11px; line-height: 1.5; }
.purchase-consent input { width: 16px; height: 16px; flex: 0 0 auto; margin: 1px 0 0; accent-color: #526a35; }
.purchase-consent a, .fine-print a, .footer-links a, .legal-page a { color: #465537; text-underline-offset: 3px; }
.admin-link { align-self: flex-start; color: #465537; font: 500 11px 'DM Mono', monospace; text-decoration: underline; text-underline-offset: 3px; }
.admin-link[hidden] { display: none; }
.admin-page { width: min(100%, 620px); margin: 68px auto 90px; }
.admin-page h1 { font-size: clamp(34px, 5vw, 52px); }
.admin-page > p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.admin-panel { margin-top: 25px; padding: 28px; border: 1px solid #dce4cf; border-radius: 16px; background: #fff; }
.admin-panel[hidden] { display: none; }
.admin-panel label:not(:first-child) { margin-top: 18px; }
.admin-status { margin-top: 18px; min-height: 22px; color: #38521f; font-size: 13px; }
.admin-back { display: inline-block; margin-top: 22px; color: #465537; font: 500 11px 'DM Mono', monospace; text-decoration: underline; text-underline-offset: 3px; }
.eyebrow, .step-label, .footer, .input-meta { font-family: 'DM Mono', monospace; }
.offer-banner { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin-top: 20px; padding: 12px 18px; border-radius: 10px; background: var(--green); text-align: center; font-size: 13px; }
.offer-banner strong { font-weight: 800; }

.intro { padding: 34px 0 45px; text-align: center; }
.titan-logo { display: block; width: 180px; height: 180px; margin: 0 auto 12px; object-fit: contain; }
.eyebrow { margin: 0 0 18px; color: #758252; font-size: 11px; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(38px, 5.5vw, 66px); line-height: 1.05; letter-spacing: -.065em; font-weight: 700; }
h1 em { color: #758252; font-style: normal; }
.intro-copy { max-width: 470px; margin: 22px auto 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.learn-money-button { display: inline-block; max-width: 100%; margin-top: 22px; padding: 13px 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.35; text-align: center; }
.learn-money-button:hover, .learn-money-button:focus-visible { background: #354b34; }
.weekly-tools-note { margin: 20px 0 0; color: var(--ink); font-size: 32px; line-height: 1.2; }
.weekly-tools-note strong { font-weight: 800; }
.upload-size-note { max-width: 650px; margin: 12px auto 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.learn-money-panel { max-width: 760px; margin: 24px auto 0; padding: 24px 28px; border: 1px solid #cbdba8; border-radius: 16px; background: #fff; text-align: left; box-shadow: 0 12px 32px rgba(38, 48, 37, .06); }
.learn-money-panel[hidden] { display: none; }
.learn-money-panel h2 { margin: 0 0 10px; font-size: 23px; text-align: center; }
.learn-money-panel p, .learn-money-panel li { color: #4f5b53; font-size: 14px; line-height: 1.6; }
.learn-money-panel p { margin: 0; }
.learn-money-panel ul { margin: 16px 0 0; padding-left: 21px; }
.learn-money-panel li + li { margin-top: 9px; }
.learn-money-panel .free-credits-copy { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dce4cf; }
.learn-money-panel a { color: #465537; text-underline-offset: 3px; }

.builder { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 39px; background: #fff; border: 1px solid #e7e8e2; border-radius: 20px; box-shadow: 0 20px 55px rgba(38, 48, 37, .055); }
.checkers-builder { margin-top: 28px; }
.chess-builder { margin-top: 28px; }
.game-preview.chess-preview { height: 650px; }
.pinball-builder { margin-top: 28px; }
.game-preview.pinball-preview { height: 650px; }
.website-maker-builder, .website-photo-builder, .invoice-generator-builder { margin-top: 28px; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: start; gap: 22px; }
.website-maker-builder .builder-form, .website-photo-builder .builder-form, .invoice-generator-builder .builder-form { width: min(100%, 640px); }
.website-maker-builder .preview-column, .website-photo-builder .preview-column, .invoice-generator-builder .preview-column { width: min(100%, 640px); text-align: center; }
.website-maker-builder .step-label, .website-photo-builder .step-label, .invoice-generator-builder .step-label { justify-content: center; }
.website-maker-builder .builder-form > h2, .website-maker-builder .form-copy, .website-photo-builder .builder-form > h2, .website-photo-builder .form-copy, .invoice-generator-builder .builder-form > h2, .invoice-generator-builder .form-copy { text-align: center; }
.website-maker-frame { grid-column: 1 / -1; display: block; width: 100%; height: 780px; border: 5px solid #131a20; border-radius: 10px; background: #fff; }
.website-photo-frame { grid-column: 1 / -1; display: block; width: 100%; height: 780px; border: 5px solid #131a20; border-radius: 10px; background: #fff; }
.invoice-generator-frame { grid-column: 1 / -1; display: block; width: 100%; height: 780px; border: 5px solid #131a20; border-radius: 10px; background: #fff; }
.game-preview.checkers-preview { height: 560px; }
.game-preview.qr-maker-preview { height: 570px; }
.match3-builder { margin-top: 28px; }
.game-preview.match3-preview { height: 810px; }
.follow-along-builder { margin-top: 28px; }
.game-preview.follow-along-preview { height: 590px; }
.step-label { display: flex; gap: 10px; align-items: center; color: #697267; font-size: 10px; font-weight: 500; letter-spacing: .11em; }
.step-label span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #c9cec4; border-radius: 50%; color: #66744c; font-size: 9px; }
h2 { margin: 22px 0 8px; font-size: 27px; letter-spacing: -.045em; }
.form-copy, .preview-caption, .share-copy > p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.form-copy { margin: 0 0 27px; }
form label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
form input, .link-row input { width: 100%; min-width: 0; padding: 14px 15px; border: 1px solid #d7dbd2; border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
form input:focus, .link-row input:focus { border-color: #83945c; box-shadow: 0 0 0 3px rgba(131, 148, 92, .13); }
.input-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: #858c84; font-size: 9px; }
.logo-label { margin-top: 20px; }
form input[type="file"] { padding: 11px; font-size: 12px; }
.logo-help { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.logo-help.error { color: #a22e2e; }
.primary-button { width: 100%; min-height: 51px; margin-top: 22px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 8px; background: var(--green); color: #172116; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: .08em; transition: transform .18s, background .18s; }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-button:hover { background: #b7e650; transform: translateY(-1px); }
.primary-button span { font-size: 19px; }
.fine-print { margin-top: 16px; color: #879087; font-size: 11px; }

.preview-column { min-width: 0; }
.game-preview { height: 380px; margin-top: 18px; overflow: hidden; border: 5px solid #131a20; border-radius: 10px; background: #000; }
.game-preview iframe { display: block; width: 100%; height: 100%; border: 0; }
.preview-caption { margin: 10px 0 0; font-size: 11px; }

.share-card { display: grid; grid-template-columns: 1fr 230px; gap: 28px; align-items: center; margin-top: 22px; padding: 30px 36px; border: 1px solid #dce4cf; border-radius: 18px; background: #edf3e4; }
.share-card[hidden] { display: none; }
.share-card h2 { margin: 15px 0 4px; }
.share-copy > p { margin: 0 0 17px; font-size: 13px; }
.link-row { display: flex; gap: 8px; }
.link-row input { background: rgba(255, 255, 255, .8); font-size: 12px; }
.secondary-button { flex: 0 0 auto; padding: 0 14px; border: 1px solid #cbd3c1; border-radius: 8px; background: #fff; color: #384135; font-family: 'DM Mono', monospace; font-size: 10px; }
.secondary-button:hover { background: #f7f9f3; }
.open-game-link { display: inline-block; margin-top: 12px; color: #465537; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .08em; text-decoration: none; }
.open-game-link:hover { text-decoration: underline; }
.local-note { margin: 11px 0 0 !important; color: #72796f; font-size: 11px !important; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 13px; border-radius: 12px; background: white; }
.qr-wrap img { display: block; width: 190px; height: 190px; image-rendering: pixelated; }
.download-link { color: #465537; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: .08em; text-decoration: none; }
.download-link:hover { text-decoration: underline; }

.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 40px 8px; }
.how-it-works > div { display: flex; align-items: center; gap: 12px; color: #5f685e; }
.how-it-works span { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border-radius: 50%; background: #e8ecdF; color: #627348; font-family: 'DM Mono', monospace; font-size: 10px; }
.how-it-works p { margin: 0; font-size: 12px; }
.footer { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 24px 12px 30px; border-top: 1px solid var(--line); color: #68716b; font-size: 12px; line-height: 1.5; text-align: center; }
.footer strong { color: var(--ink); font-size: 13px; }
.footer a { color: #465537; text-underline-offset: 3px; }
.footer-contact, .footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 11px; }
.footer-links { margin-top: 5px; }
.legal-page { max-width: 780px; margin: 54px auto 76px; }
.legal-page h1 { font-size: clamp(38px, 5vw, 56px); }
.legal-page h2 { margin: 34px 0 10px; font-size: 23px; }
.legal-page p, .legal-page li { color: #4f5b53; font-size: 15px; line-height: 1.75; }
.legal-page ul { padding-left: 23px; }
.legal-page .legal-date { margin: 9px 0 25px; color: var(--muted); font-size: 12px; }
.legal-page .legal-callout { padding: 17px 20px; border: 1px solid #cbdba8; border-radius: 10px; background: #f4f8ed; line-height: 1.6; }
.toast { position: fixed; z-index: 10; bottom: 22px; left: 50%; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 8px; background: #19221c; color: #fff; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
#noLogoWarning { width: min(420px, calc(100% - 32px)); padding: 24px; border: 1px solid #d7dbd2; border-radius: 12px; color: var(--ink); font: inherit; box-shadow: 0 20px 60px rgba(0, 0, 0, .22); }
#noLogoWarning::backdrop { background: rgba(0, 0, 0, .55); }
#noLogoWarning h2 { margin: 0 0 12px; }
#noLogoWarning p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.purchase-dialog { width: min(440px, calc(100% - 32px)); padding: 25px; border: 1px solid #d7dbd2; border-radius: 12px; color: var(--ink); font: inherit; box-shadow: 0 20px 60px rgba(0, 0, 0, .22); }
.purchase-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.purchase-dialog h2 { margin: 0 0 10px; font-size: 24px; }
.purchase-dialog > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.purchase-dialog .final-sale-notice { color: #6d3026; }
.purchase-dialog .purchase-consent { margin: 18px 0 0; font-size: 12px; }
.purchase-dialog .purchase-status { min-height: 18px; margin: 10px 0 0; color: #8a2e20; font-size: 12px; }
.purchase-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.purchase-actions .secondary-button { min-height: 39px; }
.warning-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.warning-actions button { min-height: 40px; padding: 0 14px; border: 1px solid #cbd3c1; border-radius: 8px; background: #fff; color: var(--ink); font-family: 'DM Mono', monospace; font-size: 11px; }
.warning-actions #continueNoLogo { border-color: var(--green); background: var(--green); }

@media (max-width: 760px) {
  .page-shell { padding: 0 20px; }
  .topbar { min-height: 68px; }
  .intro { padding: 30px 0 32px; }
  .titan-logo { width: 145px; height: 145px; }
  .intro-copy { max-width: 390px; font-size: 14px; }
  .builder { grid-template-columns: 1fr; gap: 34px; padding: 25px; }
  .game-preview { height: 360px; }
  .share-card { grid-template-columns: 1fr; padding: 24px; }
  .qr-wrap { width: min(100%, 230px); justify-self: center; }
  .how-it-works { grid-template-columns: 1fr; gap: 14px; padding: 29px 4px; }
}

@media (max-width: 420px) {
  .brand { font-size: 12px; }
  .auth-button, .install-button { max-width: 120px; padding: 4px; font-size: 9px; }
  .account-credit-total { margin-left: 0; }
  .builder { padding: 20px; }
  h2 { font-size: 23px; }
  .link-row { flex-direction: column; }
  .secondary-button { min-height: 42px; }
  .footer { font-size: 11px; }
}
