:root {
  color-scheme: dark;
  --bg: #0c111b;
  --bg-soft: #111827;
  --panel: rgba(20, 28, 43, .82);
  --panel-strong: #151e2e;
  --panel-soft: rgba(255, 255, 255, .035);
  --ink: #f4f7fb;
  --ink-soft: #c4cddb;
  --muted: #8792a5;
  --muted-strong: #aab5c5;
  --line: rgba(190, 207, 231, .13);
  --line-strong: rgba(190, 207, 231, .22);
  --mint: #79ebc9;
  --mint-strong: #4ed6ae;
  --violet: #9b8cff;
  --pink: #fb91bd;
  --amber: #ffc875;
  --danger: #ff9a91;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 8%, rgba(113, 93, 225, .16), transparent 27rem),
    radial-gradient(circle at 9% 61%, rgba(25, 159, 140, .105), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button, textarea, select, input { font: inherit; }
button, select, label[for] { cursor: pointer; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, .upload-zone:focus-visible {
  outline: 3px solid rgba(121, 235, 201, .44);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: .21;
}
.ambient-one { top: 16rem; right: -19rem; background: #a28cff; }
.ambient-two { bottom: -17rem; left: -16rem; background: #31cda6; opacity: .11; }

.app-shell { width: min(1510px, calc(100% - 56px)); margin: 0 auto; }

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 29px; height: 29px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; transform: rotate(-11deg); }
.brand-mark i { display: block; border-radius: 3px; background: var(--ink); }
.brand-mark i:nth-child(1) { transform: translateY(4px); }
.brand-mark i:nth-child(2) { background: var(--mint); transform: translateY(-3px); }
.brand-mark i:nth-child(3) { background: var(--pink); transform: translateY(6px); }
.brand-name { font-size: 17px; font-weight: 760; letter-spacing: -.035em; }
.brand-label { margin-left: 3px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .18em; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 12px; font-weight: 560; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(121, 235, 201, .11); transition: .2s ease; }
.connection.is-busy .connection-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 200, 117, .12); animation: pulse-dot 1.1s ease-in-out infinite; }
.connection.is-error .connection-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 154, 145, .12); }
.topbar-divider { width: 1px; height: 14px; background: var(--line-strong); }
.account-area { min-width: 0; }
.auth-open-button, .logout-button { border: 1px solid rgba(121, 235, 201, .34); border-radius: 8px; background: rgba(121, 235, 201, .08); color: #c8ffea; font-size: 11px; font-weight: 720; line-height: 1; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.auth-open-button { min-height: 32px; padding: 0 11px; }
.auth-open-button:hover, .logout-button:hover { border-color: rgba(121, 235, 201, .68); background: rgba(121, 235, 201, .15); color: #effff9; }
.account-summary { display: inline-flex; min-width: 0; align-items: center; gap: 9px; }
.credit-balance { display: inline-flex; align-items: baseline; gap: 4px; border: 1px solid rgba(255, 200, 117, .29); border-radius: 7px; padding: 5px 7px; background: rgba(255, 200, 117, .08); color: #ffe4ae; line-height: 1; }
.credit-balance b { font-size: 13px; font-weight: 760; }
.credit-balance small { color: #d9bd86; font-size: 9px; font-weight: 680; }
.checkin-open, .slots-open { min-height: 29px; border-radius: 8px; padding: 0 8px; font-size: 10px; font-weight: 760; line-height: 1; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.checkin-open { border: 1px solid rgba(255, 200, 117, .42); background: rgba(255, 200, 117, .1); color: #ffe0a6; }
.checkin-open:hover { border-color: rgba(255, 215, 153, .82); background: rgba(255, 200, 117, .18); color: #fff4db; }
.slots-open { border: 1px solid rgba(251, 145, 189, .42); background: rgba(251, 145, 189, .1); color: #ffc8df; }
.slots-open:hover { border-color: rgba(255, 174, 208, .82); background: rgba(251, 145, 189, .18); color: #fff0f6; }
.credit-redeem-open { min-height: 29px; border: 1px solid rgba(155, 140, 255, .42); border-radius: 8px; padding: 0 8px; background: rgba(155, 140, 255, .12); color: #d9d2ff; font-size: 10px; font-weight: 720; line-height: 1; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.credit-redeem-open:hover { border-color: rgba(185, 173, 255, .8); background: rgba(155, 140, 255, .2); color: #f0edff; }
.api-keys-open { min-height: 29px; border: 1px solid rgba(121, 235, 201, .36); border-radius: 8px; padding: 0 8px; background: rgba(121, 235, 201, .09); color: #c8ffea; font-size: 10px; font-weight: 760; line-height: 1; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.api-keys-open:hover { border-color: rgba(121, 235, 201, .72); background: rgba(121, 235, 201, .16); color: #effff9; }
.support-tickets-open { min-height: 29px; border: 1px solid rgba(134, 201, 255, .38); border-radius: 8px; padding: 0 8px; background: rgba(134, 201, 255, .09); color: #d4ecff; font-size: 10px; font-weight: 760; line-height: 1; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.support-tickets-open:hover { border-color: rgba(159, 214, 255, .78); background: rgba(134, 201, 255, .16); color: #f1f9ff; }
.account-email { max-width: 180px; overflow: hidden; color: #c3cedc; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { min-height: 29px; padding: 0 8px; border-color: rgba(190, 207, 231, .2); background: transparent; color: #aebaca; font-size: 10px; }
@keyframes pulse-dot { 50% { transform: scale(1.38); opacity: .68; } }

.studio { display: grid; grid-template-columns: minmax(385px, 465px) minmax(0, 1fr); gap: clamp(38px, 5.25vw, 84px); min-height: calc(100vh - 84px); padding: 51px 0 70px; }
.control-panel { min-width: 0; }
.control-panel form { position: sticky; top: 25px; }

.studio-intro { margin: 0 0 25px 3px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--mint); font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.eyebrow > span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(121, 235, 201, .1); }
.studio-intro h1 { margin: 0; color: #f9fbff; font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(34px, 3.2vw, 45px); font-weight: 600; letter-spacing: -.07em; line-height: 1.12; }
.studio-intro h1 em { color: var(--mint); font-style: normal; }
.intro-copy { max-width: 380px; margin: 15px 0 0; color: var(--muted); font-size: 14px; }

.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 12px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(11, 17, 28, .58); }
.mode-button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 43px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 690; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.mode-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mode-button:hover { color: var(--ink-soft); }
.mode-button.is-active { color: #111923; background: var(--mint); box-shadow: 0 4px 15px rgba(77, 213, 175, .2); }

.form-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(29, 40, 60, .88), rgba(16, 23, 36, .9)); box-shadow: var(--shadow); }
.form-section { padding: 23px 24px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.field-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.field-label { display: block; margin: 0; color: #eff3f9; font-size: 13px; font-weight: 700; }
.field-kicker { flex: 0 0 auto; color: #8590a2; font-size: 9px; font-weight: 750; letter-spacing: .13em; line-height: 20px; }
.accent-kicker { color: var(--violet); }

textarea {
  display: block;
  width: 100%;
  min-height: 126px;
  resize: vertical;
  border: 1px solid rgba(195, 211, 233, .14);
  border-radius: 13px;
  padding: 13px 14px;
  background: rgba(4, 8, 16, .27);
  color: var(--ink);
  caret-color: var(--mint);
  font-size: 14px;
  line-height: 1.62;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea::placeholder { color: #6f7b8e; }
textarea:hover { border-color: rgba(195, 211, 233, .24); }
textarea:focus { border-color: rgba(121, 235, 201, .68); background: rgba(4, 8, 16, .43); box-shadow: 0 0 0 4px rgba(121, 235, 201, .08); outline: 0; }
.prompt-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 29px; color: #778397; font-size: 11px; }
.prompt-meta > div { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.text-button { border: 0; padding: 2px 0; background: transparent; color: #a9b4c4; font-size: 11px; transition: color .15s ease; }
.text-button:hover { color: var(--mint); }

.prompt-bank { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.prompt-bank > span { flex: 0 0 auto; color: #728096; font-size: 11px; }
.chip-list { display: flex; min-width: 0; flex-wrap: wrap; gap: 6px; }
.prompt-chip { max-width: 132px; overflow: hidden; border: 1px solid rgba(195, 211, 233, .13); border-radius: 999px; padding: 4px 8px; background: rgba(255, 255, 255, .025); color: #b7c1cf; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.prompt-chip:hover { border-color: rgba(121, 235, 201, .47); background: rgba(121, 235, 201, .08); color: var(--mint); }

.reference-section { padding-bottom: 20px; }
.reference-subtitle { margin: 4px 0 0; color: #768297; font-size: 11px; }
.upload-zone { position: relative; min-height: 149px; overflow: hidden; border: 1px dashed rgba(155, 140, 255, .44); border-radius: 14px; background: linear-gradient(127deg, rgba(133, 114, 250, .09), rgba(121, 235, 201, .055)); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--mint); background: linear-gradient(127deg, rgba(133, 114, 250, .17), rgba(121, 235, 201, .13)); }
.upload-zone.is-dragging { transform: translateY(-1px); }
.upload-idle { display: grid; min-height: 149px; place-items: center; align-content: center; justify-items: center; gap: 5px; color: var(--muted); text-align: center; }
.upload-icon { display: grid; width: 35px; height: 35px; margin-bottom: 3px; place-items: center; border: 1px solid rgba(155, 140, 255, .31); border-radius: 11px; background: rgba(153, 139, 255, .13); color: #b6aafc; }
.upload-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.upload-idle strong { color: #dfe5ee; font-size: 12px; font-weight: 650; }
.upload-idle > span:last-child { font-size: 10px; }
.upload-preview { position: relative; min-height: 149px; }
.upload-preview img { display: block; width: 100%; height: 149px; object-fit: cover; }
.preview-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 9, 17, .82), rgba(5, 9, 17, .03) 68%); }
.preview-info { position: absolute; right: 14px; bottom: 12px; left: 14px; display: grid; gap: 2px; min-width: 0; }
.preview-badge { width: fit-content; margin-bottom: 2px; border-radius: 999px; padding: 3px 7px; background: rgba(121, 235, 201, .89); color: #10221f; font-size: 9px; font-weight: 780; letter-spacing: .02em; }
.preview-info strong { overflow: hidden; color: #f7f9fd; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.preview-info > span:last-child { color: #bbc5d3; font-size: 10px; }
.remove-reference { position: absolute; top: 9px; right: 9px; display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid rgba(255, 255, 255, .22); border-radius: 9px; background: rgba(5, 9, 17, .52); color: white; backdrop-filter: blur(8px); transition: background .15s ease, transform .15s ease; }
.remove-reference:hover { background: rgba(211, 83, 83, .8); transform: scale(1.06); }
.remove-reference svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; }
.reference-tip { margin: 8px 0 0; color: #718097; font-size: 10px; }

.settings-section { padding-top: 20px; padding-bottom: 22px; }
.field-group { margin: 0 0 17px; padding: 0; border: 0; }
.ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ratio-option { position: relative; display: grid; min-height: 68px; align-content: center; justify-items: center; gap: 3px; border: 1px solid rgba(195, 211, 233, .13); border-radius: 11px; background: rgba(2, 6, 13, .17); color: #9ca8ba; font-size: 10px; font-weight: 590; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.ratio-option:hover { border-color: rgba(195, 211, 233, .27); transform: translateY(-1px); }
.ratio-option input { position: absolute; opacity: 0; pointer-events: none; }
.ratio-option small { color: #67758a; font-size: 9px; font-weight: 550; }
.ratio-shape { display: block; margin-bottom: 1px; border: 1.4px solid currentColor; border-radius: 2px; opacity: .8; }
.ratio-square { width: 15px; height: 15px; }
.ratio-landscape { width: 20px; height: 14px; }
.ratio-portrait { width: 13px; height: 19px; }
.ratio-option:has(input:checked) { border-color: rgba(121, 235, 201, .68); background: rgba(121, 235, 201, .11); color: var(--mint); }
.ratio-option:has(input:checked) small { color: #b4e8d8; }
.ratio-option input:focus-visible + .ratio-shape { outline: 3px solid rgba(121, 235, 201, .35); outline-offset: 3px; }

.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.select-field > span { display: block; margin: 0 0 7px; color: #aeb8c8; font-size: 10px; font-weight: 650; }
.select-field select { width: 100%; height: 37px; border: 1px solid rgba(195, 211, 233, .14); border-radius: 9px; padding: 0 30px 0 10px; background: rgba(3, 7, 14, .24); color: #e2e8f1; font-size: 12px; outline: 0; transition: border-color .15s ease, background .15s ease; }
.select-field select:hover, .select-field select:focus { border-color: rgba(121, 235, 201, .48); background: rgba(3, 7, 14, .45); }
.select-field option { background: #172132; color: #f4f7fb; }
.quality-field { display: block; max-width: 216px; }

.generate-button { position: relative; display: flex; width: calc(100% - 48px); height: 53px; align-items: center; justify-content: center; gap: 9px; margin: 0 24px; overflow: hidden; border: 0; border-radius: 13px; background: linear-gradient(105deg, #77e9c7, #82e8cc 52%, #a4e8d5); color: #10201d; font-size: 14px; font-weight: 780; letter-spacing: .015em; box-shadow: 0 10px 25px rgba(71, 213, 172, .19); transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.generate-button::before { position: absolute; top: 0; left: -120%; width: 70%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.44), transparent); content: ""; transform: skewX(-18deg); transition: left .5s ease; }
.generate-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 15px 31px rgba(71, 213, 172, .28); filter: saturate(1.08); }
.generate-button:hover:not(:disabled)::before { left: 145%; }
.generate-button:disabled { background: #607e7a; color: #d9e6e3; box-shadow: none; }
.button-spark { font-size: 17px; line-height: 1; }
.button-arrow { font-size: 19px; line-height: 1; transition: transform .15s ease; }
.generate-button:hover:not(:disabled) .button-arrow { transform: translateX(3px); }
.button-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(16, 32, 29, .3); border-top-color: #10201d; border-radius: 50%; animation: spin .75s linear infinite; }
.generate-button.is-loading .button-spark, .generate-button.is-loading .button-arrow { display: none; }
.generate-button.is-loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status { min-height: 21px; margin: 9px 25px 17px; color: #8d9aac; font-size: 11px; }
.form-status.is-error { color: var(--danger); }

.canvas { min-width: 0; padding-top: 6px; }
.canvas-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; min-height: 127px; padding: 5px 0 26px; border-bottom: 1px solid var(--line); }
.canvas-heading .eyebrow { margin-bottom: 9px; color: #b3a7ff; }
.canvas-heading .eyebrow > span { box-shadow: 0 0 0 4px rgba(179, 167, 255, .1); }
.gallery-title-row { display: flex; align-items: center; gap: 11px; }
h2 { margin: 0; color: #f6f8fc; font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif; font-size: 31px; font-weight: 600; letter-spacing: -.06em; line-height: 1.1; }
.history-count { display: grid; min-width: 25px; height: 22px; place-items: center; border: 1px solid rgba(179, 167, 255, .26); border-radius: 999px; padding: 0 7px; background: rgba(155, 140, 255, .11); color: #c5bcff; font-size: 10px; font-weight: 700; }
.canvas-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.clear-history { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; background: transparent; color: #8e9bad; font-size: 11px; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.clear-history svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.clear-history:not(:disabled):hover { border-color: rgba(255, 154, 145, .25); background: rgba(255, 154, 145, .07); color: #ffb7b1; }
.clear-history:disabled { color: #596679; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(222px, 1fr)); gap: 18px; padding-top: 26px; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px auto 0; }
.history-pagination-button { border: 1px solid rgba(151, 170, 196, .24); border-radius: 7px; padding: 9px 14px; background: transparent; color: #b9c5d4; font: inherit; font-size: 12px; cursor: pointer; }
.history-pagination-button:hover:not(:disabled) { border-color: rgba(197, 188, 255, .45); color: #e2ddff; }
.history-pagination-button:disabled { cursor: wait; opacity: .5; }
.history-page-status { min-width: 84px; color: #8593a7; font-size: 11px; text-align: center; }
.empty-state { grid-column: 1 / -1; display: grid; min-height: 500px; align-content: center; justify-items: center; padding: 50px 16px; color: var(--muted); text-align: center; }
.empty-art { position: relative; width: 145px; height: 132px; margin-bottom: 19px; }
.empty-orb { position: absolute; display: block; border-radius: 50%; filter: blur(.2px); }
.orb-one { top: 8px; left: 16px; width: 76px; height: 76px; background: radial-gradient(circle at 30% 30%, #ebf6ff, #94a5ff 48%, #6c5adf); box-shadow: 0 0 43px rgba(133, 117, 253, .45); }
.orb-two { right: 9px; bottom: 11px; width: 65px; height: 65px; background: radial-gradient(circle at 35% 25%, #dbfff7, #6be3c0 49%, #288a7a); box-shadow: 0 0 35px rgba(80, 223, 182, .28); }
.empty-frame { position: absolute; top: 31px; left: 33px; width: 78px; height: 78px; border: 1px solid rgba(244, 248, 255, .76); border-radius: 12px; background: rgba(14, 20, 32, .2); backdrop-filter: blur(7px); transform: rotate(-10deg); }
.empty-frame::after { position: absolute; inset: 10px; border: 1px solid rgba(244, 248, 255, .31); border-radius: 7px; content: ""; }
.empty-spark { position: absolute; color: #fff3be; font-size: 19px; text-shadow: 0 0 16px rgba(255, 219, 135, .8); }
.spark-one { top: 2px; right: 24px; }.spark-two { bottom: 12px; left: 10px; font-size: 12px; }
.empty-eyebrow { margin: 0 0 6px; color: #a99fff; font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.empty-state h3 { margin: 0; color: #e9eef7; font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif; font-size: 25px; font-weight: 600; letter-spacing: -.05em; }
.empty-state > p:not(.empty-eyebrow) { max-width: 364px; margin: 10px 0 0; color: #7f8c9f; font-size: 12px; line-height: 1.75; }
.empty-steps { display: flex; align-items: center; gap: 10px; margin-top: 24px; color: #778499; font-size: 9px; letter-spacing: .04em; }
.empty-steps i { width: 20px; height: 1px; background: #485569; }

.image-card { position: relative; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 8px 23px rgba(0,0,0,.12); transform: translateY(0); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.image-card:hover { z-index: 1; border-color: rgba(189, 206, 232, .29); box-shadow: 0 16px 34px rgba(0,0,0,.24); transform: translateY(-4px); }
.image-open { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border: 0; padding: 0; background: #202b3a; }
.image-open::after { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 61%, rgba(4, 8, 14, .48)); content: ""; opacity: 0; transition: opacity .2s ease; }
.image-card:hover .image-open::after { opacity: 1; }
.image-open img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .4s cubic-bezier(.2,.72,.22,1); }
.image-card:hover .image-open img { transform: scale(1.055); }
.card-reference-preview { display: flex; align-items: center; width: 100%; min-height: 58px; gap: 10px; margin: 0 0 10px; overflow: hidden; border: 1px solid rgba(223, 229, 255, .24); border-radius: 7px; padding: 0; background: rgba(20, 29, 42, .72); color: #dce4f1; cursor: zoom-in; text-align: left; transition: border-color .2s ease, background .2s ease; }
.card-reference-preview img { display: block; width: 56px; height: 56px; flex: 0 0 56px; object-fit: cover; transition: transform .2s ease; }
.card-reference-preview span { color: inherit; font-size: 10px; font-weight: 700; line-height: 1; }
.card-reference-preview:hover { border-color: rgba(170, 151, 255, .88); background: rgba(31, 42, 59, .88); }
.card-reference-preview:hover img { transform: scale(1.08); }
.card-reference-preview:focus-visible { outline: 2px solid #b7a9ff; outline-offset: 2px; }
.card-mode { position: absolute; top: 10px; left: 10px; z-index: 1; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 7px; background: rgba(8, 14, 24, .6); color: #e7edf7; font-size: 9px; font-weight: 680; backdrop-filter: blur(8px); }
.image-card.is-image-to-image .card-mode { border-color: rgba(155, 140, 255, .48); background: rgba(91, 76, 174, .58); color: #f0edff; }
.card-detail { padding: 11px 12px 12px; }
.card-prompt { min-height: 34px; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #b9c4d2; font-size: 11px; line-height: 1.55; }
.card-prompt.is-collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-prompt-toggle { border: 0; margin-top: 7px; padding: 0; background: transparent; color: var(--mint); font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.card-prompt-toggle:hover { color: #c6ffec; text-decoration: underline; }
.card-prompt-toggle:focus-visible { outline: 2px solid rgba(121, 235, 201, .58); outline-offset: 3px; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 10px; }
.card-meta { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; flex-wrap: wrap; gap: 5px 7px; }
.card-actions time { color: #748197; font-size: 10px; }
.card-duration { color: #94dcca; font-size: 9px; font-weight: 690; white-space: nowrap; }
.card-action-set { display: inline-flex; align-items: center; gap: 9px; }
.card-use-reference, .card-actions a, .card-delete { border: 0; padding: 0; background: transparent; color: var(--mint); font-size: 10px; font-weight: 690; text-decoration: none; transition: color .15s ease; }
.card-use-reference:hover, .card-actions a:hover { color: #c6ffec; }
.card-delete { color: #ffaaa3; }
.card-delete:hover:not(:disabled) { color: #ffe0dc; }
.card-delete:disabled { cursor: wait; opacity: .55; }

.task-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid rgba(121, 235, 201, .23); border-radius: 15px; background: linear-gradient(145deg, rgba(22, 43, 53, .9), rgba(18, 28, 45, .94)); box-shadow: 0 10px 28px rgba(0, 0, 0, .15); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.task-card:hover { z-index: 1; border-color: rgba(121, 235, 201, .52); box-shadow: 0 17px 36px rgba(0, 0, 0, .27); transform: translateY(-3px); }
.task-card.is-running { border-color: rgba(121, 235, 201, .48); }
.task-card.is-failed { border-color: rgba(255, 154, 145, .35); background: linear-gradient(145deg, rgba(58, 34, 42, .82), rgba(27, 27, 42, .95)); }
.task-preview { position: relative; display: grid; width: 100%; aspect-ratio: 1 / 1; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(124, 239, 203, .24), rgba(43, 78, 86, .24) 35%, #172231 74%); }
.task-preview::before, .task-preview::after { position: absolute; border: 1px solid rgba(186, 247, 228, .21); border-radius: 50%; content: ""; }
.task-preview::before { width: 56%; height: 56%; animation: task-orbit 4.2s linear infinite; }
.task-preview::after { width: 75%; height: 75%; border-style: dashed; opacity: .58; animation: task-orbit 8.5s linear infinite reverse; }
.task-glow { position: absolute; width: 34%; height: 34%; border-radius: 50%; background: radial-gradient(circle, rgba(229, 255, 247, .96), rgba(121, 235, 201, .58) 33%, rgba(121, 235, 201, 0) 71%); box-shadow: 0 0 44px rgba(91, 231, 190, .5); animation: task-glow 2.1s ease-in-out infinite; }
.task-mark { position: relative; z-index: 1; color: #dffff5; font-size: clamp(38px, 5vw, 59px); line-height: 1; text-shadow: 0 0 23px rgba(151, 246, 217, .72); }
.task-progress { position: absolute; z-index: 2; right: 14%; bottom: 16%; left: 14%; height: 3px; overflow: hidden; border-radius: 999px; background: rgba(237, 255, 250, .16); }
.task-progress::before { position: absolute; top: 0; bottom: 0; left: -42%; width: 42%; border-radius: inherit; background: linear-gradient(90deg, transparent, #9effde, transparent); content: ""; animation: task-progress 1.55s ease-in-out infinite; }
.task-status { position: absolute; z-index: 3; top: 10px; right: 10px; border: 1px solid rgba(157, 255, 222, .38); border-radius: 999px; padding: 4px 7px; background: rgba(12, 31, 32, .72); color: #c8ffeb; font-size: 9px; font-weight: 720; backdrop-filter: blur(8px); }
.task-card.is-failed .task-preview { background: radial-gradient(circle at 50% 45%, rgba(255, 159, 148, .18), rgba(104, 58, 73, .18) 38%, #25202c 75%); }
.task-card.is-failed .task-preview::before, .task-card.is-failed .task-preview::after { animation: none; border-color: rgba(255, 181, 173, .2); }
.task-card.is-failed .task-glow { background: radial-gradient(circle, rgba(255, 225, 220, .82), rgba(255, 139, 129, .43) 35%, rgba(255, 139, 129, 0) 71%); box-shadow: 0 0 37px rgba(255, 130, 121, .32); animation: none; }
.task-card.is-failed .task-mark { color: #ffd5d1; font-size: 36px; text-shadow: 0 0 18px rgba(255, 154, 145, .55); }
.task-card.is-failed .task-mark::after { content: "!"; }
.task-card.is-failed .task-progress { background: rgba(255, 173, 166, .22); }
.task-card.is-failed .task-progress::before { display: none; }
.task-card.is-failed .task-status { border-color: rgba(255, 173, 166, .36); background: rgba(57, 24, 31, .72); color: #ffd0cb; }
.task-detail { padding: 11px 12px 12px; }
.task-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 16px; margin-top: 10px; }
.task-status-copy { min-width: 0; overflow: hidden; color: #97aaa9; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.task-card.is-failed .task-status-copy { color: #e9aaa5; }
.task-actions time { flex: 0 0 auto; color: #78908d; font-size: 10px; }
.task-dismiss { flex: 0 0 auto; border: 0; padding: 0; background: transparent; color: #ffb1aa; font-size: 10px; font-weight: 700; }
.task-dismiss:hover { color: #ffe0dc; }
@keyframes task-orbit { to { transform: rotate(360deg); } }
@keyframes task-glow { 50% { opacity: .72; transform: scale(.83); } }
@keyframes task-progress { 0% { transform: translateX(0); } 100% { transform: translateX(340%); } }

.lightbox { width: min(1020px, calc(100% - 32px)); max-height: calc(100vh - 32px); margin: auto; overflow: auto; border: 1px solid rgba(213, 225, 242, .2); border-radius: 18px; padding: 0; background: #101724; color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.6); }
.lightbox::backdrop { background: rgba(4, 7, 12, .8); backdrop-filter: blur(5px); }
.lightbox-image-wrap { position: relative; display: grid; min-height: min(330px, calc(100vh - 165px)); max-height: calc(100vh - 165px); place-items: center; background: #090e16; }
.lightbox > .lightbox-image-wrap img { display: block; width: 100%; max-height: calc(100vh - 165px); object-fit: contain; }
.lightbox-image-wrap.is-loading img { visibility: hidden; }
.lightbox-image-wrap.is-loading::after { position: absolute; width: 26px; height: 26px; border: 2px solid rgba(195, 208, 231, .26); border-top-color: var(--mint); border-radius: 50%; content: ""; animation: lightbox-loading .8s linear infinite; }
@keyframes lightbox-loading { to { transform: rotate(360deg); } }
.lightbox-close { position: absolute; z-index: 2; top: 13px; right: 13px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(7, 11, 20, .66); color: white; backdrop-filter: blur(8px); }
.lightbox-close:hover { background: rgba(34, 44, 62, .9); }
.lightbox-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; }
.lightbox-footer { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 83px; padding: 15px 18px; }
.lightbox-footer > div:first-child { min-width: 0; }
.lightbox-overline { display: block; margin-bottom: 4px; color: #a99fff; font-size: 9px; font-weight: 720; letter-spacing: .13em; text-transform: uppercase; }
.lightbox-footer p { max-width: 620px; margin: 0; overflow: hidden; color: #c4ceda; font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-duration { display: inline-block; margin-top: 7px; color: #91dfc9; font-size: 10px; font-weight: 700; }
.lightbox-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.use-reference-button, .download-link { border: 1px solid rgba(178, 193, 216, .25); border-radius: 9px; padding: 8px 10px; background: transparent; color: #d7e2ed; font-size: 11px; font-weight: 620; text-decoration: none; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.use-reference-button:hover { border-color: rgba(155, 140, 255, .65); background: rgba(155, 140, 255, .13); color: #e8e4ff; }
.download-link { border-color: rgba(121, 235, 201, .52); background: rgba(121, 235, 201, .12); color: #c7ffec; }
.download-link:hover { background: rgba(121, 235, 201, .21); }

.site-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 25px 0 36px; border-top: 1px solid var(--line); color: #778499; font-size: 11px; line-height: 1.65; }
.site-footer p { max-width: 580px; margin: 0; }
.site-footer nav { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px 17px; }
.site-footer a { color: #aeb9c9; text-decoration: none; transition: color .15s ease; }
.site-footer a:hover { color: var(--mint); }

.policy-page { min-height: 100vh; }
.policy-shell { width: min(900px, calc(100% - 56px)); margin: 0 auto; padding-bottom: 58px; }
.policy-topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.back-link { color: #9eabba; font-size: 12px; text-decoration: none; transition: color .15s ease; }
.back-link:hover { color: var(--mint); }
.policy-card { margin-top: 52px; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 5vw, 54px); background: linear-gradient(145deg, rgba(29, 40, 60, .88), rgba(16, 23, 36, .9)); box-shadow: var(--shadow); }
.policy-kicker { margin: 0 0 12px; color: var(--mint); font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.policy-card h1 { margin: 0; color: #f9fbff; font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(31px, 5vw, 45px); font-weight: 600; letter-spacing: -.06em; line-height: 1.12; }
.policy-effective { margin: 12px 0 0; color: #8390a4; font-size: 12px; }
.policy-content { margin-top: 37px; color: #bdc7d5; font-size: 14px; line-height: 1.85; }
.policy-content h2 { margin: 34px 0 10px; color: #edf3fb; font-family: inherit; font-size: 17px; font-weight: 720; letter-spacing: 0; }
.policy-content h2:first-child { margin-top: 0; }
.policy-content p { margin: 0 0 14px; }
.policy-content ul, .policy-content ol { margin: 0 0 16px; padding-left: 1.35em; }
.policy-content li + li { margin-top: 6px; }
.policy-content a { color: var(--mint); text-underline-offset: 3px; }
.policy-note { margin-top: 28px !important; border: 1px solid rgba(121, 235, 201, .23); border-radius: 13px; padding: 13px 15px; background: rgba(121, 235, 201, .07); color: #d1efe6; font-size: 13px; }
.policy-footer { margin-top: 26px; }

/* Compact standalone policy documents served at /privacy, /terms,
   /content-policy, and /copyright. */
main.policy-page { width: min(860px, calc(100% - 56px)); margin: 0 auto; padding: 48px 0 68px; }
main.policy-page .policy-back { display: inline-block; margin-bottom: 42px; color: #aeb9c9; font-size: 12px; text-decoration: none; transition: color .15s ease; }
main.policy-page .policy-back:hover { color: var(--mint); }
main.policy-page > h1 { margin: 0; color: #f9fbff; font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(32px, 5vw, 46px); font-weight: 600; letter-spacing: -.06em; line-height: 1.12; }
main.policy-page .policy-updated { margin: 12px 0 29px; color: #8390a4; font-size: 12px; }
main.policy-page > section { border: 1px solid var(--line); border-radius: 16px; margin-top: 13px; padding: 22px 24px; background: linear-gradient(145deg, rgba(29, 40, 60, .72), rgba(16, 23, 36, .78)); }
main.policy-page > section h2 { margin: 0 0 9px; color: #edf3fb; font-family: inherit; font-size: 16px; font-weight: 720; letter-spacing: 0; }
main.policy-page > section p { margin: 0; color: #bdc7d5; font-size: 13px; line-height: 1.85; }
main.policy-page > section a { color: var(--mint); text-underline-offset: 3px; }
.email-verification-form { margin-top: 20px; }
.email-verification-form button { min-height: 40px; border: 0; border-radius: 8px; padding: 0 16px; background: var(--mint); color: #10201d; font-size: 13px; font-weight: 780; }
.email-verification-form button:hover { background: #a5f1d9; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.auth-dialog { width: min(410px, calc(100vw - 28px)); overflow: visible; border: 1px solid rgba(190, 207, 231, .2); border-radius: 12px; padding: 25px; background: #151f2e; color: var(--ink); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
.auth-dialog::backdrop { background: rgba(4, 8, 15, .76); backdrop-filter: blur(5px); }
.auth-close { position: absolute; top: 11px; right: 12px; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(190, 207, 231, .21); border-radius: 50%; background: rgba(11, 17, 28, .72); color: #dbe5ef; font-size: 20px; line-height: 1; }
.auth-close:hover { border-color: rgba(121, 235, 201, .54); color: var(--mint); }
.auth-dialog-header { padding-right: 37px; }
.auth-kicker { margin: 0 0 7px; color: var(--mint); font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.auth-dialog h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 22px 0 17px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5, 9, 17, .36); }
.auth-tab { min-height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 710; }
.auth-tab.is-active { background: rgba(121, 235, 201, .13); color: #c8ffeb; }
.auth-form { display: grid; gap: 13px; }
.auth-field { display: grid; gap: 7px; color: #b7c3d2; font-size: 11px; font-weight: 680; }
.auth-field input { width: 100%; height: 42px; border: 1px solid rgba(190, 207, 231, .18); border-radius: 8px; padding: 0 11px; background: rgba(5, 9, 17, .42); color: var(--ink); outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.auth-field input:focus { border-color: rgba(121, 235, 201, .7); box-shadow: 0 0 0 3px rgba(121, 235, 201, .1); }
.auth-submit { min-height: 42px; margin-top: 4px; border: 0; border-radius: 8px; background: var(--mint); color: #10201d; font-size: 13px; font-weight: 780; }
.auth-submit:hover:not(:disabled) { background: #a5f1d9; }
.auth-message { min-height: 17px; margin: -2px 0 0; color: #91a0b2; font-size: 11px; line-height: 1.5; }
.auth-message.is-error { color: var(--danger); }
.checkin-dialog, .slots-dialog { overflow: auto; border-radius: 14px; padding: 25px; color: var(--ink); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
.checkin-dialog::backdrop, .slots-dialog::backdrop { background: rgba(4, 8, 15, .78); backdrop-filter: blur(5px); }
.checkin-dialog { width: min(410px, calc(100vw - 28px)); border: 1px solid rgba(255, 200, 117, .29); background: #252015; }
.slots-dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 28px); border: 1px solid rgba(251, 145, 189, .28); background: #241724; }
.engagement-close { position: absolute; top: 11px; right: 12px; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(190, 207, 231, .21); border-radius: 50%; background: rgba(11, 17, 28, .72); color: #dbe5ef; font-size: 20px; line-height: 1; }
.engagement-close:hover { border-color: rgba(255, 200, 117, .62); color: #ffe1a8; }
.engagement-header { padding-right: 37px; }
.engagement-header > p, .engagement-header > div > p { margin: 0 0 7px; color: var(--amber); font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.engagement-header h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.checkin-reward-card { display: grid; justify-items: center; gap: 5px; margin: 22px 0 15px; border: 1px solid rgba(255, 200, 117, .2); border-radius: 12px; padding: 24px 18px; background: radial-gradient(circle at 50% 15%, rgba(255, 200, 117, .2), transparent 70%), rgba(8, 7, 4, .28); }
.checkin-reward-card > span { color: #c8ae7f; font-size: 10px; font-weight: 720; letter-spacing: .1em; }
.checkin-reward-card strong { color: #ffe0a3; font-size: 16px; font-weight: 720; }
.checkin-reward-card strong b { font-family: "Iowan Old Style", Georgia, serif; font-size: 52px; font-weight: 600; line-height: 1; }
.checkin-reward-card small { color: #978464; font-size: 10px; }
.checkin-claim { width: 100%; min-height: 43px; border: 0; border-radius: 8px; background: var(--amber); color: #271b08; font-size: 13px; font-weight: 800; }
.checkin-claim:hover:not(:disabled) { background: #ffda9f; }
.checkin-claim:disabled { opacity: .62; }
.engagement-message { min-height: 18px; margin: 11px 0 0; color: #ad9b80; font-size: 11px; line-height: 1.55; text-align: center; }
.engagement-message.is-error { color: var(--danger); }
.slots-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.slots-header > span { flex: 0 0 auto; margin-top: 8px; border: 1px solid rgba(255, 200, 117, .25); border-radius: 999px; padding: 5px 9px; color: #dec28d; font-size: 10px; }
.slots-header > span b { color: #ffe2a9; font-size: 12px; }
.slot-machine { position: relative; margin: 20px 0 14px; border: 1px solid rgba(251, 145, 189, .2); border-radius: 15px; padding: 28px 12px 12px; background: linear-gradient(155deg, rgba(102, 32, 69, .4), rgba(5, 4, 8, .55)); box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 14px 30px rgba(4, 1, 5, .2); }
.slot-machine-top { position: absolute; top: 7px; right: 13px; left: 13px; display: flex; height: 15px; align-items: center; justify-content: center; gap: 8px; color: #ffb9d5; font-size: 8px; letter-spacing: .18em; }
.slot-machine-top b { font-weight: 850; text-shadow: 0 0 12px rgba(255, 110, 170, .46); }
.slot-machine-top i { width: 5px; height: 5px; border-radius: 50%; background: #704052; box-shadow: 0 0 0 2px rgba(255, 255, 255, .025); }
.slot-machine.is-spinning .slot-machine-top i { animation: slot-light-chase .5s ease-in-out infinite alternate; background: #ffcf63; box-shadow: 0 0 9px #ffb64b; }
.slot-machine.is-spinning .slot-machine-top i:nth-of-type(2) { animation-delay: -.25s; }
.slot-machine.is-spinning .slot-machine-top i:nth-last-of-type(2) { animation-delay: -.12s; }
.slot-machine.is-spinning .slot-machine-top i:last-of-type { animation-delay: -.37s; }
.slot-reels { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; overflow: hidden; border: 1px solid rgba(255, 226, 237, .14); border-radius: 11px; padding: 8px; background: #0b070c; box-shadow: inset 0 0 30px rgba(0, 0, 0, .68); }
.slot-reels::after { position: absolute; z-index: 4; top: 50%; right: 4px; left: 4px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 94, 158, .3) 10%, rgba(255, 226, 236, .6) 50%, rgba(255, 94, 158, .3) 90%, transparent); box-shadow: 0 0 8px rgba(255, 85, 150, .2); content: ""; pointer-events: none; transform: translateY(-1px); transition: opacity .2s ease, box-shadow .2s ease; }
.slot-reels.is-win::after { background: linear-gradient(90deg, transparent, #ffc95f 12%, #fff7ce 50%, #ffc95f 88%, transparent); box-shadow: 0 0 8px #ffad3d, 0 0 22px rgba(255, 169, 44, .82); animation: slot-payline-win .62s ease-in-out 3 alternate; }
.slot-reel-window { position: relative; z-index: 1; height: 104px; min-width: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: linear-gradient(180deg, #e9dce3 0%, #fffafd 48%, #e5d5dd 100%); box-shadow: inset 0 10px 19px rgba(84, 39, 60, .17), inset 0 -10px 19px rgba(84, 39, 60, .17), 0 0 0 1px rgba(0, 0, 0, .24); transform-origin: 50% 50%; transition: border-color .18s ease, box-shadow .18s ease; }
.slot-reel-window::after { position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(20, 7, 13, .22), transparent 25%, transparent 75%, rgba(20, 7, 13, .22)); content: ""; pointer-events: none; }
.slot-reel-strip { width: 100%; will-change: transform; }
.slot-symbol { display: grid; width: 100%; height: 104px; place-items: center; color: #1e1017; font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 48px; line-height: 1; filter: drop-shadow(0 3px 1px rgba(46, 17, 30, .16)); user-select: none; }
.slot-reels.is-spinning .slot-reel-window:not(.has-landed) .slot-symbol { filter: blur(1.4px) saturate(.9); }
.slot-reels.is-spinning .slot-reel-window:not(.has-landed) { border-color: rgba(255, 198, 220, .26); box-shadow: inset 0 10px 20px rgba(84, 39, 60, .24), inset 0 -10px 20px rgba(84, 39, 60, .24), 0 0 12px rgba(255, 94, 158, .12); }
.slot-reels.is-spinning .slot-reel-window.is-stopping .slot-symbol { filter: blur(.45px) saturate(1); }
.slot-reel-window.is-teasing { border-color: rgba(255, 207, 96, .72); animation: slot-tease-glow .5s ease-in-out infinite alternate; }
.slot-reel-window.is-stopped { animation: slot-stop-bounce .3s cubic-bezier(.2, .8, .3, 1); }
.slot-reel-window.is-match { border-color: rgba(255, 207, 96, .92); box-shadow: inset 0 0 22px rgba(255, 203, 78, .22), 0 0 8px #ffb348, 0 0 20px rgba(255, 174, 64, .52); }
.slot-reels.is-big-win { animation: slot-machine-win .55s ease-in-out 3 alternate; }
.slot-reels.is-jackpot { border-color: rgba(255, 218, 99, .78); box-shadow: inset 0 0 35px rgba(255, 191, 48, .22), 0 0 24px rgba(255, 175, 43, .4); }
.slot-confetti { position: absolute; z-index: 7; inset: -22px -8px -35px; overflow: hidden; border-radius: 18px; pointer-events: none; }
.slot-confetti i { position: absolute; top: -12px; left: var(--slot-x); width: 7px; height: 12px; border-radius: 2px; background: var(--slot-color); opacity: 0; transform: rotate(var(--slot-rotation)); animation: slot-confetti-fall var(--slot-duration) cubic-bezier(.15, .75, .3, 1) var(--slot-delay) forwards; }
@keyframes slot-light-chase { from { opacity: .3; transform: scale(.75); } to { opacity: 1; transform: scale(1.18); } }
@keyframes slot-stop-bounce { 0% { transform: translateY(-2px) scaleY(1.02); } 45% { transform: translateY(4px) scaleY(.96); } 75% { transform: translateY(-1px) scaleY(1.01); } 100% { transform: none; } }
@keyframes slot-tease-glow { to { box-shadow: inset 0 0 19px rgba(255, 203, 78, .18), 0 0 14px rgba(255, 174, 64, .65); } }
@keyframes slot-payline-win { to { opacity: .72; box-shadow: 0 0 13px #ffd65e, 0 0 31px rgba(255, 173, 43, .92); } }
@keyframes slot-machine-win { to { filter: brightness(1.18); transform: scale(1.008); } }
@keyframes slot-confetti-fall { 0% { opacity: 0; transform: translate3d(0, -8px, 0) rotate(0); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate3d(var(--slot-drift), 185px, 0) rotate(var(--slot-spin)); } }
.slot-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.slot-form label { display: grid; gap: 6px; color: #d4afc0; font-size: 10px; font-weight: 700; }
.slot-form input { width: 100%; height: 42px; border: 1px solid rgba(251, 145, 189, .28); border-radius: 8px; padding: 0 11px; background: rgba(5, 4, 8, .4); color: #fff0f6; outline: 0; }
.slot-form input:focus { border-color: rgba(251, 145, 189, .75); box-shadow: 0 0 0 3px rgba(251, 145, 189, .1); }
.slot-form button { min-height: 42px; border: 0; border-radius: 8px; padding: 0 18px; background: var(--pink); color: #27131d; font-size: 12px; font-weight: 800; }
.slot-form button:hover:not(:disabled) { background: #ffb1d1; }
.slot-rules { margin-top: 16px; border-top: 1px solid rgba(251, 145, 189, .16); padding-top: 13px; }
.slot-rules-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.slot-rules-heading h3 { margin: 0; color: #efd8e3; font-size: 11px; font-weight: 750; }
.slot-rules-heading span { color: #a88898; font-size: 9px; }
.slot-rule-summary { display: grid; gap: 5px; margin: 0 0 9px; padding: 0; list-style: none; }
.slot-rule-summary li { position: relative; display: grid; grid-template-columns: minmax(118px, .8fr) minmax(0, 1.4fr); gap: 9px; padding-left: 11px; color: #b89caa; font-size: 10px; line-height: 1.45; }
.slot-rule-summary li::before { position: absolute; top: .55em; left: 1px; width: 4px; height: 4px; border-radius: 50%; background: #f58fba; content: ""; }
.slot-rule-summary b { color: #ead2dd; font-weight: 720; }
.slot-rule-example { margin: 0 0 10px; color: #a88898; font-size: 9px; line-height: 1.5; }
#slot-rule-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.slot-rule-item { display: grid; min-width: 0; justify-items: center; gap: 4px; border-radius: 7px; padding: 8px 2px; background: rgba(255, 255, 255, .035); }
.slot-rule-item b { font-size: 20px; }
.slot-rule-item span { color: #efb8ce; font-size: 9px; font-weight: 760; }
.slot-history { margin-top: 15px; border-top: 1px solid rgba(251, 145, 189, .16); padding-top: 13px; }
.slot-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.slot-history-heading h3 { margin: 0; color: #efd8e3; font-size: 11px; font-weight: 750; }
.slot-history-heading span { color: #a88898; font-size: 9px; }
.slot-history-list { min-height: 38px; }
.slot-history-empty { margin: 0; padding: 12px 0 7px; color: #8f7482; font-size: 10px; text-align: center; }
.slot-history-empty.is-error { color: var(--danger); }
.slot-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid rgba(251, 145, 189, .1); padding: 7px 0; }
.slot-history-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; }
.slot-history-symbols { color: #fff1f7; font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 17px; font-weight: 400; line-height: 1; white-space: nowrap; }
.slot-history-main > span { overflow: hidden; color: #b99aaa; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.slot-history-result { display: grid; min-width: 64px; justify-items: end; gap: 2px; }
.slot-history-result b { font-size: 10px; font-weight: 780; }
.slot-history-result b.is-win { color: #ffd16e; }
.slot-history-result b.is-even { color: #c5abb8; }
.slot-history-result b.is-loss { color: #a98797; }
.slot-history-result time { color: #806976; font-size: 8px; white-space: nowrap; }
.slot-history-pagination { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 10px; }
.slot-history-pagination button { min-height: 29px; border: 1px solid rgba(251, 145, 189, .23); border-radius: 6px; padding: 0 10px; background: rgba(251, 145, 189, .04); color: #d9b5c5; font: inherit; font-size: 9px; font-weight: 700; }
.slot-history-pagination button:hover:not(:disabled) { border-color: rgba(251, 145, 189, .58); color: #fff0f6; }
.slot-history-pagination button:disabled { cursor: not-allowed; opacity: .4; }
.slot-history-pagination span { min-width: 68px; color: #927b87; font-size: 9px; text-align: center; }
.slot-disclaimer { margin: 12px 0 0; color: #806778; font-size: 9px; text-align: center; }
.credit-redeem-dialog { width: min(410px, calc(100vw - 28px)); overflow: visible; border: 1px solid rgba(177, 163, 255, .28); border-radius: 12px; padding: 25px; background: #19172b; color: var(--ink); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
.credit-redeem-dialog::backdrop { background: rgba(4, 8, 15, .76); backdrop-filter: blur(5px); }
.credit-redeem-close { position: absolute; top: 11px; right: 12px; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(190, 207, 231, .21); border-radius: 50%; background: rgba(11, 17, 28, .72); color: #dbe5ef; font-size: 20px; line-height: 1; }
.credit-redeem-close:hover { border-color: rgba(185, 173, 255, .65); color: #dcd5ff; }
.credit-redeem-header { padding-right: 37px; }
.credit-redeem-header p { margin: 0 0 7px; color: #b6a9ff; font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.credit-redeem-header h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.credit-purchase-link { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; border: 1px solid rgba(121, 235, 201, .38); border-radius: 8px; background: rgba(121, 235, 201, .09); color: #c8ffeb; font-size: 12px; font-weight: 730; text-decoration: none; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.credit-purchase-link:hover { border-color: rgba(121, 235, 201, .76); background: rgba(121, 235, 201, .16); color: #effff9; transform: translateY(-1px); }
.credit-purchase-link:focus-visible { outline: 3px solid rgba(121, 235, 201, .32); outline-offset: 3px; }
.credit-purchase-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.credit-redeem-form { display: grid; gap: 13px; margin-top: 13px; }
.credit-redeem-form label { display: grid; gap: 7px; color: #c3bddb; font-size: 11px; font-weight: 680; }
.credit-redeem-form input { width: 100%; height: 42px; border: 1px solid rgba(185, 173, 255, .29); border-radius: 8px; padding: 0 11px; background: rgba(5, 9, 17, .42); color: var(--ink); outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.credit-redeem-form input:focus { border-color: rgba(185, 173, 255, .78); box-shadow: 0 0 0 3px rgba(155, 140, 255, .12); }
.credit-redeem-form button[type="submit"] { min-height: 42px; margin-top: 4px; border: 0; border-radius: 8px; background: #b8adff; color: #171426; font-size: 13px; font-weight: 780; }
.credit-redeem-form button[type="submit"]:hover:not(:disabled) { background: #d1c9ff; }
.credit-redeem-form p { min-height: 17px; margin: -2px 0 0; color: #aba5c2; font-size: 11px; line-height: 1.5; }
.credit-redeem-form p.is-error { color: var(--danger); }

.api-keys-dialog { width: min(540px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); overflow: auto; border: 1px solid rgba(121, 235, 201, .26); border-radius: 12px; padding: 25px; background: #13232a; color: var(--ink); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
.api-keys-dialog::backdrop { background: rgba(4, 8, 15, .76); backdrop-filter: blur(5px); }
.api-keys-close { position: absolute; top: 11px; right: 12px; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(190, 207, 231, .21); border-radius: 50%; background: rgba(11, 17, 28, .72); color: #dbe5ef; font-size: 20px; line-height: 1; }
.api-keys-close:hover { border-color: rgba(121, 235, 201, .65); color: var(--mint); }
.api-keys-header { padding-right: 37px; }
.api-keys-header p { margin: 0 0 7px; color: var(--mint); font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.api-keys-header h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.api-keys-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: #a7b6c5; font-size: 11px; }
.api-keys-intro a { color: #a9f3dd; font-weight: 700; text-decoration: none; }
.api-keys-intro a:hover { color: #effff9; text-decoration: underline; text-underline-offset: 3px; }
.api-key-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 16px; }
.api-key-create-form label { display: grid; min-width: 0; gap: 7px; color: #c4d5df; font-size: 11px; font-weight: 680; }
.api-key-create-form input, .api-key-reveal input { width: 100%; height: 40px; min-width: 0; border: 1px solid rgba(121, 235, 201, .27); border-radius: 8px; padding: 0 10px; background: rgba(4, 10, 14, .44); color: #e9fff8; font-size: 12px; outline: 0; }
.api-key-create-form input:focus, .api-key-reveal input:focus { border-color: rgba(121, 235, 201, .75); box-shadow: 0 0 0 3px rgba(121, 235, 201, .1); }
.api-key-create-form button, .api-key-reveal button { min-height: 40px; border: 0; border-radius: 8px; padding: 0 12px; background: var(--mint); color: #10201d; font-size: 12px; font-weight: 760; }
.api-key-create-form button:hover:not(:disabled), .api-key-reveal button:hover:not(:disabled) { background: #a5f1d9; }
.api-key-reveal { margin-top: 14px; border-top: 1px solid rgba(121, 235, 201, .23); border-bottom: 1px solid rgba(121, 235, 201, .23); padding: 13px 0; }
.api-key-reveal p { margin: 0 0 8px; color: #ffe2a9; font-size: 11px; font-weight: 700; }
.api-key-reveal > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.api-key-reveal input { color: #ffe9b9; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; }
.api-key-list-section { margin-top: 18px; }
.api-key-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.api-key-list-heading h3 { margin: 0; color: #e8f4f0; font-size: 12px; font-weight: 750; }
.api-key-list-heading span { color: #7fa899; font-size: 10px; font-weight: 680; }
.api-key-list { border-top: 1px solid rgba(190, 207, 231, .14); }
.api-key-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(190, 207, 231, .12); padding: 11px 2px; }
.api-key-detail { display: grid; min-width: 0; gap: 3px; }
.api-key-detail strong { overflow: hidden; color: #e7f4ef; font-size: 11px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.api-key-detail code { color: #8edfc6; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; }
.api-key-detail span { color: #849cac; font-size: 9px; line-height: 1.45; }
.api-key-revoke { flex: 0 0 auto; border: 0; padding: 4px 0; background: transparent; color: #ffaaa3; font-size: 10px; font-weight: 710; }
.api-key-revoke:hover:not(:disabled) { color: #ffe0dc; }
.api-key-list-empty { margin: 0; padding: 18px 2px; color: #849cac; font-size: 11px; text-align: center; }
.api-key-message { min-height: 17px; margin: 13px 0 0; color: #a9cbbb; font-size: 11px; line-height: 1.5; }
.api-key-message.is-error { color: var(--danger); }

.support-tickets-dialog { width: min(810px, calc(100vw - 28px)); max-height: min(790px, calc(100vh - 28px)); overflow: auto; border: 1px solid rgba(134, 201, 255, .27); border-radius: 12px; padding: 25px; background: #13202e; color: var(--ink); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
.support-tickets-dialog::backdrop { background: rgba(4, 8, 15, .76); backdrop-filter: blur(5px); }
.support-tickets-close { position: absolute; top: 11px; right: 12px; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(190, 207, 231, .21); border-radius: 50%; background: rgba(11, 17, 28, .72); color: #dbe5ef; font-size: 20px; line-height: 1; }
.support-tickets-close:hover { border-color: rgba(134, 201, 255, .7); color: #d8f0ff; }
.support-tickets-header { padding-right: 37px; }
.support-tickets-header p { margin: 0 0 7px; color: #8dccff; font-size: 9px; font-weight: 760; letter-spacing: .16em; }
.support-tickets-header h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.support-ticket-form { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr) auto; align-items: end; gap: 10px; margin-top: 18px; border-top: 1px solid rgba(134, 201, 255, .18); border-bottom: 1px solid rgba(134, 201, 255, .15); padding: 16px 0; }
.support-ticket-form label { display: grid; min-width: 0; gap: 7px; color: #bed2e5; font-size: 11px; font-weight: 680; }
.support-ticket-form input, .support-ticket-form textarea { width: 100%; min-width: 0; border: 1px solid rgba(134, 201, 255, .27); border-radius: 8px; padding: 9px 10px; background: rgba(4, 10, 16, .42); color: #eef7ff; font: inherit; font-size: 12px; outline: 0; }
.support-ticket-form input { height: 40px; }
.support-ticket-form textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
.support-ticket-form input:focus, .support-ticket-form textarea:focus { border-color: rgba(134, 201, 255, .76); box-shadow: 0 0 0 3px rgba(134, 201, 255, .1); }
.support-ticket-form-actions { display: grid; align-items: end; gap: 7px; min-width: 100px; }
.support-ticket-form-actions button { min-height: 40px; border: 0; border-radius: 8px; padding: 0 12px; background: #91cfff; color: #102132; font: inherit; font-size: 12px; font-weight: 760; white-space: nowrap; }
.support-ticket-form-actions button:hover:not(:disabled) { background: #b5e1ff; }
.support-ticket-form-actions button:disabled { cursor: wait; opacity: .6; }
.support-ticket-form-actions p { min-height: 17px; margin: 0; color: #9bb6ca; font-size: 10px; line-height: 1.45; }
.support-ticket-form-actions p.is-error { color: var(--danger); }
.support-tickets-workspace { display: grid; grid-template-columns: minmax(210px, .78fr) minmax(0, 1.42fr); min-height: 330px; margin-top: 17px; border: 1px solid rgba(190, 207, 231, .14); border-radius: 9px; background: rgba(5, 11, 18, .26); }
.support-ticket-history, .support-ticket-conversation { min-width: 0; padding: 15px; }
.support-ticket-history { border-right: 1px solid rgba(190, 207, 231, .13); }
.support-ticket-section-heading { display: flex; min-height: 29px; align-items: flex-start; justify-content: space-between; gap: 11px; }
.support-ticket-section-heading h3 { margin: 0; color: #e7f1fa; font-size: 12px; font-weight: 760; }
.support-ticket-section-heading > span:not(.support-ticket-status) { color: #7e9bb2; font-size: 10px; font-weight: 700; }
.support-ticket-section-heading p { margin: 4px 0 0; overflow-wrap: anywhere; color: #9db5c8; font-size: 10px; line-height: 1.45; }
.support-ticket-list { display: grid; gap: 6px; margin-top: 12px; }
.support-ticket-list-empty { margin: 26px 4px; color: #819aae; font-size: 11px; line-height: 1.5; text-align: center; }
.support-ticket-list-item { display: grid; gap: 5px; width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 10px; background: transparent; color: inherit; text-align: left; }
.support-ticket-list-item:hover { border-color: rgba(134, 201, 255, .22); background: rgba(134, 201, 255, .06); }
.support-ticket-list-item.is-active { border-color: rgba(134, 201, 255, .43); background: rgba(134, 201, 255, .1); }
.support-ticket-list-item strong { overflow: hidden; color: #dcebf7; font-size: 11px; font-weight: 710; text-overflow: ellipsis; white-space: nowrap; }
.support-ticket-list-item span { color: #819aae; font-size: 9px; line-height: 1.4; }
.support-ticket-list-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.support-ticket-list-item time { color: #718ba2; font-size: 9px; }
.support-ticket-status { display: inline-flex; flex: 0 0 auto; align-items: center; border: 1px solid rgba(164, 181, 199, .32); border-radius: 999px; padding: 3px 7px; color: #c7d4e0; font-size: 9px; font-weight: 720; white-space: nowrap; }
.support-ticket-status.is-open { border-color: rgba(255, 201, 124, .47); color: #ffe1a5; }
.support-ticket-status.is-answered { border-color: rgba(121, 235, 201, .42); color: #a7f3d6; }
.support-ticket-pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; }
.support-ticket-pagination button { border: 1px solid rgba(134, 201, 255, .25); border-radius: 7px; padding: 6px 8px; background: rgba(134, 201, 255, .05); color: #bcdff7; font: inherit; font-size: 10px; font-weight: 700; }
.support-ticket-pagination button:hover:not(:disabled) { border-color: rgba(134, 201, 255, .58); color: #e8f6ff; }
.support-ticket-pagination button:disabled { cursor: wait; opacity: .45; }
.support-ticket-pagination span { min-width: 68px; color: #7f9aaf; font-size: 9px; text-align: center; }
.support-ticket-messages { display: grid; align-content: start; gap: 10px; min-height: 252px; margin-top: 14px; }
.support-ticket-message { max-width: min(88%, 440px); border: 1px solid rgba(190, 207, 231, .15); border-radius: 8px; padding: 10px 11px; background: rgba(23, 35, 50, .72); }
.support-ticket-message.is-user { justify-self: start; border-color: rgba(134, 201, 255, .25); background: rgba(47, 83, 111, .25); }
.support-ticket-message.is-admin { justify-self: end; border-color: rgba(121, 235, 201, .25); background: rgba(36, 82, 70, .25); }
.support-ticket-message header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.support-ticket-message strong { color: #dcebf6; font-size: 10px; font-weight: 720; }
.support-ticket-message.is-admin strong { color: #b9f4dd; }
.support-ticket-message time { color: #849caf; font-size: 9px; white-space: nowrap; }
.support-ticket-message p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #c7d7e4; font-size: 11px; line-height: 1.6; }
.support-ticket-conversation-empty { align-self: center; margin: 0; color: #819aae; font-size: 11px; text-align: center; }

.api-docs-page { width: min(100% - 48px, 920px); margin: 0 auto; padding: 46px 0 70px; }
.api-docs-page > h1 { margin: 0; color: #f9fbff; font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", serif; font-size: 42px; font-weight: 600; letter-spacing: 0; line-height: 1.12; }
.api-docs-page > .api-docs-lead { max-width: 670px; margin: 13px 0 28px; color: #aab7c7; font-size: 14px; line-height: 1.7; }
.api-docs-page > section { margin-top: 13px; border-top: 1px solid var(--line); padding: 22px 0 0; }
.api-docs-page h2 { margin: 0 0 10px; color: #edf8f4; font-family: inherit; font-size: 17px; font-weight: 730; letter-spacing: 0; }
.api-docs-page p, .api-docs-page li { color: #bdc7d5; font-size: 13px; line-height: 1.75; }
.api-docs-page p { margin: 0; }
.api-docs-page ul { margin: 8px 0 0; padding-left: 19px; }
.api-docs-page code { color: #a9f3dd; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .92em; }
.api-docs-code { margin: 12px 0 0; overflow-x: auto; border: 1px solid rgba(121, 235, 201, .18); border-radius: 8px; padding: 15px; background: #0a1319; color: #d7f5eb; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre; }

@media (max-width: 1040px) {
  .studio { grid-template-columns: minmax(350px, 410px) minmax(0, 1fr); gap: 36px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .version-label, .topbar-divider { display: none; }
}

@media (max-width: 810px) {
  .app-shell { width: min(100% - 36px, 720px); }
  .studio { grid-template-columns: 1fr; gap: 45px; padding-top: 35px; }
  .control-panel form { position: static; }
  .canvas { padding-top: 0; }
  .canvas-heading { min-height: auto; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .empty-state { min-height: 370px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 12px; }
  .site-footer nav { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .app-shell { width: min(100% - 28px, 720px); }
  .topbar { height: 68px; }
  .brand-label { display: none; }
  .brand-name { font-size: 16px; }
  .topbar-right { gap: 0; }
  .connection { display: none; }
  .account-email { display: none; }
  .account-summary { gap: 4px; }
  .credit-balance { gap: 0; padding-right: 5px; padding-left: 5px; }
  .credit-balance small { display: none; }
  .checkin-open, .slots-open, .credit-redeem-open, .api-keys-open, .support-tickets-open, .logout-button { min-height: 28px; padding-right: 5px; padding-left: 5px; font-size: 9px; }
  .studio { min-height: calc(100vh - 68px); padding: 29px 0 42px; gap: 37px; }
  .studio-intro { margin-bottom: 20px; }
  .studio-intro h1 { font-size: 34px; }
  .intro-copy { margin-top: 11px; font-size: 13px; }
  .form-section { padding: 19px 17px; }
  .prompt-bank { align-items: flex-start; flex-direction: column; gap: 6px; }
  .prompt-chip { max-width: 120px; }
  .generate-button { width: calc(100% - 34px); margin: 0 17px; }
  .form-status { margin-right: 18px; margin-left: 18px; }
  .canvas-heading { padding-bottom: 21px; }
  h2 { font-size: 28px; }
  .canvas-subtitle { font-size: 12px; }
  .clear-history { padding-right: 0; }
  .clear-history svg { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 18px; }
  .card-detail { padding: 9px; }
  .card-actions time { display: none; }
  .card-actions { justify-content: flex-end; }
  .empty-state { min-height: 370px; }
  .lightbox { width: min(100% - 18px, 1020px); border-radius: 14px; }
  .lightbox-footer { align-items: flex-start; flex-direction: column; gap: 12px; }
  .lightbox-footer p { max-width: 100%; white-space: normal; }
  .lightbox-actions { width: 100%; }
  .lightbox-actions > * { flex: 1; text-align: center; }
  .policy-shell { width: min(100% - 28px, 900px); padding-bottom: 36px; }
  .policy-topbar { height: 68px; }
  .policy-card { margin-top: 28px; }
  .policy-content { font-size: 13px; }
  main.policy-page { width: min(100% - 28px, 860px); padding-top: 30px; padding-bottom: 42px; }
  main.policy-page .policy-back { margin-bottom: 29px; }
  main.policy-page > section { padding: 18px; }
  .api-keys-dialog { width: min(100vw - 20px, 540px); padding: 20px 17px; }
  .slots-dialog { width: min(100vw - 20px, 560px); padding: 20px 17px; }
  .slot-machine { padding-right: 8px; padding-left: 8px; }
  .slot-reels { gap: 6px; padding: 6px; }
  .slot-reel-window, .slot-symbol { height: 82px; }
  .slot-symbol { font-size: 39px; }
  .slot-form { grid-template-columns: 1fr; }
  .slot-form button { width: 100%; }
  #slot-rule-list { grid-template-columns: repeat(4, 1fr); }
  .slot-rule-summary li { grid-template-columns: minmax(110px, .75fr) minmax(0, 1.25fr); gap: 7px; }
  .slot-history-main { gap: 7px; }
  .slot-history-symbols { font-size: 15px; }
  .api-key-create-form { grid-template-columns: 1fr; }
  .api-key-create-form button { width: 100%; }
  .support-tickets-dialog { width: min(100vw - 20px, 810px); padding: 20px 17px; }
  .support-ticket-form { grid-template-columns: 1fr; }
  .support-ticket-form-actions { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .support-ticket-form-actions button { width: auto; }
  .support-tickets-workspace { grid-template-columns: 1fr; }
  .support-ticket-history { border-right: 0; border-bottom: 1px solid rgba(190, 207, 231, .13); }
  .support-ticket-messages { min-height: 210px; }
  .api-docs-page { width: min(100% - 28px, 920px); padding-top: 30px; padding-bottom: 42px; }
  .api-docs-page > h1 { font-size: 32px; }
}

@media (max-width: 430px) {
  .brand-name { display: none; }
  .brand { gap: 0; }
  .account-summary { gap: 2px; }
  .checkin-open, .slots-open, .credit-redeem-open, .api-keys-open, .support-tickets-open, .logout-button { padding-right: 4px; padding-left: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
