* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ffd43b; outline-offset: 3px; }
.source-page, .source-page body { width: 100%; height: 100%; overflow: hidden; background: #14110e; }
.source-page body { display: flex; justify-content: center; align-items: center; }
.source-page canvas { display: block; width: min(100vw, 56.25vh); height: min(100vh, 177.7778vw); background: #14110e; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.host-page { background: #0a0b0d; color: #f7f7f4; }
.masthead { background: #14161a; color: #f7f7f4; padding: 24px max(24px, calc((100vw - 1380px) / 2)); border-bottom: 5px solid #ffd43b; }
.masthead a { color: #d7d9de; font-size: 14px; text-decoration: none; }
.masthead h1 { font: 800 clamp(34px, 4vw, 50px) Arial, Helvetica, sans-serif; margin: 12px 0; }
.masthead p { max-width: 760px; line-height: 1.55; color: #d7d9de; margin: 0 0 6px; }
.layout { max-width: 1380px; margin: auto; padding: 28px 24px 60px; display: grid; grid-template-columns: minmax(300px, 426px) minmax(0, 1fr); gap: 28px; align-items: start; }
.preview-wrap { background: #14110e; border: 1px solid #353a44; border-radius: 20px; overflow: hidden; box-shadow: 0 12px 35px #14161a0f; }
.preview-heading { padding: 15px 17px; background: #252931; display: flex; justify-content: space-between; gap: 14px; align-items: center; font-size: 14px; font-weight: 800; letter-spacing: 0.9px; }
.preview-heading span { color: #ffd43b; }
.preview-wrap iframe { display: block; width: 100%; aspect-ratio: 9 / 16; border: 0; background: #14110e; }
.caption { font-size: 14px; line-height: 1.55; color: #a9afb9; margin: 15px 3px; }
.right-column { display: grid; gap: 20px; min-width: 0; }
.panel { background: #14161a; border: 1px solid #353a44; border-radius: 18px; padding: 24px; min-width: 0; }
.panel h2 { font-size: 22px; margin: 0 0 9px; letter-spacing: -0.3px; }
.panel h3 { font-size: 15px; margin: 24px 0 12px; }
.muted { color: #a9afb9; font-size: 14px; line-height: 1.55; margin: 6px 0 17px; }
.modes { display: flex; gap: 7px; flex-wrap: wrap; margin: 19px 0 13px; }
.modes button, .secondary { border: 1px solid #353a44; background: #252931; color: #f7f7f4; padding: 11px 14px; border-radius: 9px; font-size: 14px; font-weight: 700; }
.modes button[aria-pressed="true"] { background: #ffd43b; color: #101114; border-color: #ffd43b; }
.status { padding: 12px 14px; background: #252931; border-left: 3px solid #ffd43b; font-size: 14px; line-height: 1.6; }
.status p { margin: 0; }
.status small { color: #a9afb9; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 15px; }
.primary { background: #ffd43b; border: 1px solid #ffd43b; color: #101114; padding: 12px 18px; border-radius: 9px; font-size: 14px; font-weight: 700; }
.primary:hover { background: #ffd43b; }
.field-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.field-row label { flex: 1; min-width: 150px; }
.field-row button { height: 44px; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
label { display: block; font-size: 14px; font-weight: 700; line-height: 1.55; }
label input:not([type="checkbox"]), label select, label textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid #353a44; border-radius: 8px; background: #0a0b0d; color: #f7f7f4; min-width: 0; font: inherit; }
label textarea { min-height: 180px; resize: vertical; }
#settings label:has(textarea) { grid-column: 1 / -1; }
.check-row { display: flex; gap: 15px 20px; flex-wrap: wrap; margin: 19px 0 0; }
.check-row label { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.check-row input { accent-color: #ffd43b; width: 17px; height: 17px; }
.effects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 15px; }
.effects button { padding: 14px 6px; border: 1px solid #353a44; border-radius: 11px; background: #252931; color: #f7f7f4; font-weight: 700; font-size: 14px; }
.source-link { width: 100%; padding: 13px; border: 1px solid #353a44; border-radius: 9px; background: #252931; color: #f7f7f4; font-size: 14px; margin: 8px 0; }
.source-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.source-actions a { color: #ffd43b; font-size: 14px; font-weight: 600; }
.note { border-top: 1px solid #353a44; margin-top: 19px; padding-top: 14px; font-size: 14px; line-height: 1.55; color: #a9afb9; }
details { font-size: 14px; color: #a9afb9; margin-top: 16px; }
summary { cursor: pointer; font-weight: 600; }
#field { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; list-style: none; padding: 12px 0 0; max-height: 180px; overflow: auto; margin: 0; font-size: 14px; }
.rules { margin: 0; line-height: 1.65; color: #a9afb9; font-size: 14px; }
html:not(.tt-shell) .gift-picker-status { min-height: 1.2em; margin: 8px 0 12px; color: #a9afb9; font-size: 14px; line-height: 1.45; }
.gift-legend { display: grid; gap: 8px; margin: 0 0 14px; }
.gift-legend-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #353a44; border-radius: 10px; background: #14161a; }
.gift-legend-copy { min-width: 0; }
.gift-legend-copy strong, .gift-legend-copy span { display: block; overflow-wrap: anywhere; }
.gift-legend-copy strong { font-size: 14px; }
.gift-legend-copy .gift-legend-meta { color: #a9afb9; font-size: 14px; font-weight: 500; }
.gift-legend-action { font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: #ffd43b; font-weight: 800; }
.gift-thumb-shell, .gift-thumb, .gift-thumb-fallback { width: 46px; height: 46px; border-radius: 8px; }
.gift-thumb, .gift-thumb-fallback { background: #252931; }
.gift-thumb { display: block; object-fit: contain; }
.gift-thumb-fallback { display: grid; place-items: center; padding: 4px; color: #a9afb9; font-size: 14px; font-weight: 700; line-height: 1.15; text-align: center; }
.gift-legend-row .secondary { min-height: 38px; }
.panel form { margin: 0; }
.footer { max-width: 1380px; margin: 0 auto; padding: 0 24px 28px; font-size: 14px; color: #a9afb9; }
@media (min-width: 1100px) { .left-column { position: sticky; top: 20px; } }
@media (max-width: 760px) {
  .masthead { padding: 22px 18px; }
  .layout { grid-template-columns: 1fr; padding: 20px 14px 35px; gap: 20px; }
  .left-column { max-width: 426px; width: 100%; margin: auto; }
  .panel { padding: 20px 17px; }
  .input-grid, .effects { grid-template-columns: 1fr 1fr; }
  .modes button { padding: 10px 12px; font-size: 14px; }
  .caption { font-size: 14px; }
  .masthead h1 { margin: 10px 0; }
  .footer { padding-left: 18px; }
  #field { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .effects { grid-template-columns: 1fr; }
  .gift-legend-row { grid-template-columns: 46px minmax(0, 1fr); }
  .gift-legend-row .secondary { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
