@font-face { font-family: "Pixer"; src: url("./fonts/Pixer.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "PasticheNF"; src: url("./fonts/PasticheNF.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "36Days"; src: url("./fonts/36Days.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Rockybilly"; src: url("./fonts/Rockybilly.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "BigLou"; src: url("./fonts/BigLou.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "SweetHusky"; src: url("./fonts/SweetHusky.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Munsteria"; src: url("./fonts/Munsteria.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Trashco"; src: url("./fonts/Trashco.ttf") format("truetype"); font-display: swap; }

.text-image-app {
  --ti-bg: #071c14;
  --ti-panel: #0d291e;
  --ti-ink: #f7f1e4;
  --ti-muted: #a5b8ac;
  --ti-line: rgba(178, 211, 191, .18);
  --ti-gold: #f4bd55;
  --ti-mint: #78d6aa;
  min-width: 0;
  overflow: hidden;
  padding: clamp(24px, 4vw, 62px);
  color: var(--ti-ink);
  background: radial-gradient(780px 460px at 93% 0, rgba(58, 151, 109, .18), transparent 65%), radial-gradient(rgba(244, 189, 85, .055) 1px, transparent 1.5px), var(--ti-bg);
  background-size: auto, 20px 20px, auto;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.text-image-app *, .text-image-app *::before, .text-image-app *::after { box-sizing: border-box; }
.text-image-app button, .text-image-app input, .text-image-app select { font: inherit; }

.text-image-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: clamp(28px, 6vw, 88px); align-items: end; max-width: 1480px; margin: 0 auto clamp(32px, 5vw, 58px); }
.text-image-eyebrow { margin: 0 0 15px; color: var(--ti-gold); font-size: .74rem; font-weight: 850; letter-spacing: .19em; text-transform: uppercase; }
.text-image-intro h1 { margin: 0; color: var(--ti-ink); font: 600 clamp(2.8rem, 5.8vw, 6.1rem)/.96 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.text-image-intro h1 em { color: var(--ti-gold); font-weight: 500; }
.text-image-intro-side > p { margin: 0 0 24px; color: #c1cec6; font-size: clamp(.96rem, 1.35vw, 1.13rem); line-height: 1.7; }
.text-image-intro-side ul { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; border-block: 1px solid var(--ti-line); }
.text-image-intro-side li { display: grid; gap: 4px; min-width: 0; padding: 13px 12px; border-right: 1px solid var(--ti-line); }
.text-image-intro-side li:first-child { padding-left: 0; }
.text-image-intro-side li:last-child { border-right: 0; }
.text-image-intro-side strong { color: var(--ti-ink); font-size: .73rem; }
.text-image-intro-side span { color: var(--ti-muted); font-size: .58rem; line-height: 1.35; }

.text-image-workspace { display: grid; grid-template-columns: minmax(340px, .52fr) minmax(0, 1.48fr); gap: clamp(18px, 2.5vw, 32px); align-items: start; max-width: 1480px; margin: 0 auto; }
.text-image-sidebar, .text-image-editor { min-width: 0; padding: clamp(19px, 2.7vw, 34px); background: linear-gradient(150deg, rgba(17, 51, 37, .97), rgba(8, 31, 22, .99)); border: 1px solid var(--ti-line); border-radius: clamp(18px, 2vw, 28px); box-shadow: 0 28px 60px -46px #000; }
.text-image-section-heading { display: flex; gap: 13px; align-items: flex-start; }
.text-image-section-heading > span { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; color: #382904; background: linear-gradient(145deg, #ffd77e, var(--ti-gold)); border-radius: 50%; font-size: .69rem; font-weight: 900; }
.text-image-section-heading h2 { margin: 0; color: var(--ti-ink); font: 600 clamp(1.3rem, 2vw, 1.72rem)/1.15 Georgia, serif; letter-spacing: -.02em; }
.text-image-section-heading p { margin: 5px 0 0; color: var(--ti-muted); font-size: .74rem; line-height: 1.48; }

.drop-zone { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; margin-top: 26px; padding: 16px; background: rgba(4, 21, 14, .55); border: 1px dashed rgba(120, 214, 170, .5); border-radius: 15px; cursor: pointer; outline: 0; transition: border-color .2s, background .2s, transform .2s; }
.drop-zone:hover, .drop-zone.dragover { background: rgba(54, 133, 96, .16); border-color: var(--ti-mint); transform: translateY(-1px); }
.drop-zone:focus-visible { box-shadow: 0 0 0 3px rgba(244, 189, 85, .25); }
.drop-mark { grid-row: 1 / 3; display: grid; place-items: center; width: 43px; height: 43px; color: #352704; background: linear-gradient(145deg, #ffd77e, var(--ti-gold)); border-radius: 12px; font-size: 1.35rem; }
.drop-zone > div { display: grid; gap: 3px; min-width: 0; }
.drop-zone strong { color: var(--ti-ink); font-size: .75rem; }
.drop-zone small { color: var(--ti-muted); font-size: .61rem; }
.file-name { grid-column: 2; overflow: hidden; margin: 0; color: #789184; font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }

.control-section { margin-top: 21px; padding-top: 19px; border-top: 1px solid var(--ti-line); }
.control-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.control-section > header span { color: var(--ti-gold); font-size: .58rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.control-section h3 { margin: 0; color: var(--ti-ink); font-size: .78rem; }
.control-group { min-width: 0; margin-bottom: 13px; }
.control-group > label { display: block; margin-bottom: 7px; color: var(--ti-muted); font-size: .63rem; font-weight: 750; }
.text-image-app input[type="text"], .text-image-app select { width: 100%; min-width: 0; padding: 10px 11px; color: #eef6f1; background: rgba(4, 21, 14, .65); border: 1px solid var(--ti-line); border-radius: 10px; outline: 0; }
.text-image-app input[type="text"]::placeholder { color: #71887b; }
.text-image-app input[type="text"]:focus, .text-image-app select:focus { border-color: var(--ti-mint); box-shadow: 0 0 0 3px rgba(120, 214, 170, .1); }
.text-image-app select { color-scheme: dark; }
.text-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#add-text-btn { display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; color: #332504; background: linear-gradient(145deg, #ffd77e, var(--ti-gold)); border: 0; border-radius: 10px; cursor: pointer; font-size: .69rem; font-weight: 850; }
#add-text-btn b { font-size: 1rem; }
#add-text-btn:disabled { opacity: .38; cursor: not-allowed; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.color-control > div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 42px; padding: 5px 9px 5px 5px; background: rgba(4, 21, 14, .65); border: 1px solid var(--ti-line); border-radius: 10px; }
#font-color { width: 38px; height: 30px; padding: 0; background: transparent; border: 0; cursor: pointer; }
#color-value { color: var(--ti-muted); font-size: .61rem; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 39px; gap: 8px; align-items: center; min-height: 42px; padding: 6px 8px; background: rgba(4, 21, 14, .65); border: 1px solid var(--ti-line); border-radius: 10px; }
.range-row input { width: 100%; min-width: 0; accent-color: var(--ti-gold); cursor: pointer; }
.range-row output { color: var(--ti-gold); text-align: right; font-size: .59rem; font-weight: 800; }
.style-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.style-row > span { color: var(--ti-muted); font-size: .63rem; font-weight: 750; }
.text-styles { display: flex; gap: 6px; }
.text-styles button { display: grid; place-items: center; width: 34px; height: 32px; padding: 0; color: var(--ti-ink); background: rgba(4, 21, 14, .6); border: 1px solid var(--ti-line); border-radius: 8px; cursor: pointer; font-size: .7rem; }
.text-styles button.active, .text-styles button[aria-pressed="true"] { color: #342604; background: var(--ti-gold); border-color: var(--ti-gold); }
.text-styles button:disabled { opacity: .3; cursor: not-allowed; }
#delete-text-btn { color: #ed8f83; }

.filter-switches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 15px; }
.filter-switches label { position: relative; cursor: pointer; }
.filter-switches input { position: absolute; opacity: 0; pointer-events: none; }
.filter-switches span { display: block; padding: 9px 6px; color: var(--ti-muted); text-align: center; background: rgba(4, 21, 14, .5); border: 1px solid var(--ti-line); border-radius: 9px; font-size: .59rem; font-weight: 750; }
.filter-switches input:checked + span { color: #342604; background: var(--ti-gold); border-color: var(--ti-gold); }
.filter-switches input:focus-visible + span { outline: 3px solid rgba(120, 214, 170, .25); }
.filter-sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.filter-sliders label { display: grid; gap: 5px; color: var(--ti-muted); font-size: .58rem; }
.filter-sliders input { width: 100%; min-width: 0; accent-color: var(--ti-mint); cursor: pointer; }

.text-image-editor { position: sticky; top: 18px; }
.editor-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
#download-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; padding: 10px 15px; color: #332504; background: linear-gradient(145deg, #ffd77e, var(--ti-gold)); border: 0; border-radius: 999px; cursor: pointer; font-size: .69rem; font-weight: 850; }
#download-btn span { font-size: .95rem; }
#download-btn:disabled { opacity: .34; cursor: not-allowed; }
.canvas-stage { display: grid; place-items: center; min-width: 0; min-height: clamp(430px, 55vw, 740px); overflow: hidden; padding: clamp(12px, 2vw, 25px); background-color: #06160f; background-image: linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.025) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.025) 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; border: 1px solid var(--ti-line); border-radius: 18px; }
.canvas-placeholder { display: grid; justify-items: center; max-width: 330px; text-align: center; }
.canvas-placeholder > span { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; color: var(--ti-gold); background: rgba(244, 189, 85, .08); border: 1px solid rgba(244, 189, 85, .22); border-radius: 20px; transform: rotate(-4deg); }
.canvas-placeholder i { font: 500 2.5rem Georgia, serif; }
.canvas-placeholder strong { color: var(--ti-ink); font: 600 1.15rem Georgia, serif; }
.canvas-placeholder p { margin: 8px 0 0; color: var(--ti-muted); font-size: .69rem; line-height: 1.55; }
#canvas-container { position: relative; max-width: 100%; max-height: 100%; overflow: hidden; background: #fff; box-shadow: 0 22px 55px rgba(0, 0, 0, .4); }
#canvas-container > .canvas-container { max-width: 100%; max-height: 100%; }
#canvas-container canvas { max-width: 100%; height: auto !important; }
.canvas-note { display: flex; gap: 9px; margin: 13px 2px 0; color: var(--ti-muted); font-size: .62rem; line-height: 1.5; }
.canvas-note span { color: var(--ti-mint); }

@media (max-width: 1020px) {
  .text-image-intro { grid-template-columns: 1fr; gap: 24px; }
  .text-image-workspace { grid-template-columns: 1fr; }
  .text-image-editor { position: static; }
  .canvas-stage { min-height: min(74vw, 680px); }
}
@media (max-width: 620px) {
  .text-image-app { padding: 23px 13px 30px; }
  .text-image-intro { margin-bottom: 24px; }
  .text-image-intro h1 { font-size: clamp(2.55rem, 13.7vw, 4.2rem); }
  .text-image-intro-side ul { grid-template-columns: 1fr; }
  .text-image-intro-side li, .text-image-intro-side li:first-child { padding: 9px 0; border-right: 0; border-bottom: 1px solid var(--ti-line); }
  .text-image-intro-side li:last-child { border-bottom: 0; }
  .text-image-sidebar, .text-image-editor { padding: 17px 13px; border-radius: 18px; }
  .editor-toolbar { gap: 10px; }
  .editor-toolbar .text-image-section-heading > span { display: none; }
  #download-btn { padding-inline: 11px; }
  .canvas-stage { min-height: 72vw; padding: 8px; border-radius: 13px; }
}
@media (max-width: 390px) {
  .control-grid, .filter-sliders { grid-template-columns: 1fr; }
  .filter-switches { grid-template-columns: 1fr; }
}
