/* --- FONT REGISTRATION --- */
@font-face { font-family: 'Akijo'; src: url('../fonts/akijo.woff') format('woff'); }
@font-face { font-family: 'Apollo-regular'; src: url('../fonts/apollo-regular.woff') format('woff'); }
@font-face { font-family: 'Barbara'; src: url('../fonts/barbara.woff') format('woff'); }
@font-face { font-family: 'Bomberfraktur'; src: url('../fonts/bomberfraktur.woff') format('woff'); }
@font-face { font-family: 'Brno2016'; src: url('../fonts/brno2016.woff') format('woff'); }
@font-face { font-family: 'Broadnibber'; src: url('../fonts/broadnibber.woff') format('woff'); }
@font-face { font-family: 'Capsizun'; src: url('../fonts/capsizun.woff') format('woff'); }
@font-face { font-family: 'Chaos'; src: url('../fonts/chaos.woff') format('woff'); }
@font-face { font-family: 'Cofesans'; src: url('../fonts/cofesans.woff') format('woff'); }
@font-face { font-family: 'Coffeetime'; src: url('../fonts/coffeetime.woff') format('woff'); }
@font-face { font-family: 'Crystal'; src: url('../fonts/crystal.woff') format('woff'); }
@font-face { font-family: 'Dahlia'; src: url('../fonts/dahlia.woff') format('woff'); }
@font-face { font-family: 'Dap'; src: url('../fonts/dap.woff') format('woff'); }
@font-face { font-family: 'Dematerialized'; src: url('../fonts/dematerialized.woff') format('woff'); }
@font-face { font-family: 'Dewy'; src: url('../fonts/dewy.woff') format('woff'); }
@font-face { font-family: 'Doublebubble'; src: url('../fonts/doublebubble.woff') format('woff'); }
@font-face { font-family: 'Erki30'; src: url('../fonts/erki30.woff') format('woff'); }
@font-face { font-family: 'Escapistdiaries'; src: url('../fonts/escapistdiaries.woff') format('woff'); }
@font-face { font-family: 'Esimene'; src: url('../fonts/esimene.woff') format('woff'); }
@font-face { font-family: 'Exquisitecorpsetypeface'; src: url('../fonts/exquisitecorpsetypeface.woff') format('woff'); }
@font-face { font-family: 'Fairytype'; src: url('../fonts/fairytype.woff') format('woff'); }
@font-face { font-family: 'Faktory'; src: url('../fonts/faktory.woff') format('woff'); }
@font-face { font-family: 'Fallengum'; src: url('../fonts/fallengum.woff') format('woff'); }
@font-face { font-family: 'Fiato'; src: url('../fonts/fiato.woff') format('woff'); }
@font-face { font-family: 'Floraandfauna'; src: url('../fonts/floraandfauna.woff') format('woff'); }
@font-face { font-family: 'Flowstate'; src: url('../fonts/flowstate.woff') format('woff'); }
@font-face { font-family: 'Fontanne'; src: url('../fonts/fontanne.woff') format('woff'); }
@font-face { font-family: 'Fontenstein-regular'; src: url('../fonts/fontenstein-regular.woff') format('woff'); }
@font-face { font-family: 'Franz'; src: url('../fonts/franz.woff') format('woff'); }
@font-face { font-family: 'Frisbee'; src: url('../fonts/frisbee.woff') format('woff'); }
@font-face { font-family: 'Gary'; src: url('../fonts/gary.woff') format('woff'); }
@font-face { font-family: 'Gog-regular'; src: url('../fonts/gog-regular.woff') format('woff'); }
@font-face { font-family: 'Heavy'; src: url('../fonts/heavy.woff') format('woff'); }
@font-face { font-family: 'Helipleumon'; src: url('../fonts/helipleumon.woff') format('woff'); }
@font-face { font-family: 'Hellplague'; src: url('../fonts/hellplague.woff') format('woff'); }
@font-face { font-family: 'Hypha'; src: url('../fonts/hypha.woff') format('woff'); }
@font-face { font-family: 'Idreamofletters'; src: url('../fonts/idreamofletters.woff') format('woff'); }
@font-face { font-family: 'Igorrounded'; src: url('../fonts/igorrounded.woff') format('woff'); }
@font-face { font-family: 'Imogen'; src: url('../fonts/imogen.woff') format('woff'); }
@font-face { font-family: 'Jaan'; src: url('../fonts/jaan.woff') format('woff'); }
@font-face { font-family: 'Kalevgrotesk'; src: url('../fonts/kalevgrotesk.woff') format('woff'); }
@font-face { font-family: 'Kalevgrotesk2'; src: url('../fonts/kalevgrotesk2.woff') format('woff'); }
@font-face { font-family: 'Kalligrogro'; src: url('../fonts/kalligrogro.woff') format('woff'); }
@font-face { font-family: 'Kalligrokalli'; src: url('../fonts/kalligrokalli.woff') format('woff'); }
@font-face { font-family: 'Kandi3'; src: url('../fonts/kandi3.woff') format('woff'); }
@font-face { font-family: 'Ketchupaddict'; src: url('../fonts/ketchupaddict.woff') format('woff'); }
@font-face { font-family: 'Kevad'; src: url('../fonts/kevad.woff') format('woff'); }
@font-face { font-family: 'Keynotesans'; src: url('../fonts/keynotesans.woff') format('woff'); }
@font-face { font-family: 'Kiwi'; src: url('../fonts/kiwi.woff') format('woff'); }
@font-face { font-family: 'Kollektiivcollective'; src: url('../fonts/kollektiivcollective.woff') format('woff'); }
@font-face { font-family: 'Kulm'; src: url('../fonts/kulm.woff') format('woff'); }
@font-face { font-family: 'Kykeon'; src: url('../fonts/kykeon.woff') format('woff'); }
@font-face { font-family: 'Lambiseim'; src: url('../fonts/lambiseim.woff') format('woff'); }
@font-face { font-family: 'Lazyglamour'; src: url('../fonts/lazyglamour.woff') format('woff'); }
@font-face { font-family: 'Leimzy'; src: url('../fonts/leimzy.woff') format('woff'); }
@font-face { font-family: 'Leone'; src: url('../fonts/leone.woff') format('woff'); }
@font-face { font-family: 'Libreofficesans'; src: url('../fonts/libreofficesans.woff') format('woff'); }
@font-face { font-family: 'Lopsakas-regular'; src: url('../fonts/lopsakas-regular.woff') format('woff'); }
@font-face { font-family: 'Lumberjack'; src: url('../fonts/lumberjack.woff') format('woff'); }
@font-face { font-family: 'Madis-igor'; src: url('../fonts/madis-igor.woff') format('woff'); }
@font-face { font-family: 'Masurka'; src: url('../fonts/masurka.woff') format('woff'); }
@font-face { font-family: 'Maurizio'; src: url('../fonts/maurizio.woff') format('woff'); }
@font-face { font-family: 'Mehhanism'; src: url('../fonts/mehhanism.woff') format('woff'); }
@font-face { font-family: 'Molot'; src: url('../fonts/molot.woff') format('woff'); }
@font-face { font-family: 'Mozzarella'; src: url('../fonts/mozzarella.woff') format('woff'); }
@font-face { font-family: 'Mscurvy'; src: url('../fonts/mscurvy.woff') format('woff'); }
@font-face { font-family: 'Mymapssansalbersequalareaconic'; src: url('../fonts/mymapssansalbersequalareaconic.woff') format('woff'); }
@font-face { font-family: 'Mymapssansazimuthalequidistant'; src: url('../fonts/mymapssansazimuthalequidistant.woff') format('woff'); }
@font-face { font-family: 'Mymapssansbonne'; src: url('../fonts/mymapssansbonne.woff') format('woff'); }
@font-face { font-family: 'Mymapssanscylindricalequalarea'; src: url('../fonts/mymapssanscylindricalequalarea.woff') format('woff'); }
@font-face { font-family: 'Mymapssanslambertconformalconic'; src: url('../fonts/mymapssanslambertconformalconic.woff') format('woff'); }
@font-face { font-family: 'Mymapssansmercator'; src: url('../fonts/mymapssansmercator.woff') format('woff'); }
@font-face { font-family: 'Mymapssansorthographic'; src: url('../fonts/mymapssansorthographic.woff') format('woff'); }
@font-face { font-family: 'Mymapssanspolyconic'; src: url('../fonts/mymapssanspolyconic.woff') format('woff'); }
@font-face { font-family: 'Mymapssansrobinson'; src: url('../fonts/mymapssansrobinson.woff') format('woff'); }
@font-face { font-family: 'Mymapssanssinusoidal'; src: url('../fonts/mymapssanssinusoidal.woff') format('woff'); }
@font-face { font-family: 'Mymapssansstereographic'; src: url('../fonts/mymapssansstereographic.woff') format('woff'); }
@font-face { font-family: 'Mymapssanstransversemercator'; src: url('../fonts/mymapssanstransversemercator.woff') format('woff'); }
@font-face { font-family: 'Mymapssanswinkeltripel'; src: url('../fonts/mymapssanswinkeltripel.woff') format('woff'); }
@font-face { font-family: 'Naps'; src: url('../fonts/naps.woff') format('woff'); }
@font-face { font-family: 'Napulo'; src: url('../fonts/napulo.woff') format('woff'); }
@font-face { font-family: 'Newpoetic'; src: url('../fonts/newpoetic.woff') format('woff'); }
@font-face { font-family: 'Nocturnal'; src: url('../fonts/nocturnal.woff') format('woff'); }
@font-face { font-family: 'Ofortuna'; src: url('../fonts/ofortuna.woff') format('woff'); }
@font-face { font-family: 'Ornamental'; src: url('../fonts/ornamental.woff') format('woff'); }
@font-face { font-family: 'Owlcave'; src: url('../fonts/owlcave.woff') format('woff'); }
@font-face { font-family: 'Pakkonen'; src: url('../fonts/pakkonen.woff') format('woff'); }
@font-face { font-family: 'Radio'; src: url('../fonts/radio.woff') format('woff'); }
@font-face { font-family: 'Rammus'; src: url('../fonts/rammus.woff') format('woff'); }
@font-face { font-family: 'Safaritraveller'; src: url('../fonts/safaritraveller.woff') format('woff'); }
@font-face { font-family: 'Sato'; src: url('../fonts/sato.woff') format('woff'); }
@font-face { font-family: 'Sens'; src: url('../fonts/sens.woff') format('woff'); }
@font-face { font-family: 'Sensiblesenseless'; src: url('../fonts/sensiblesenseless.woff') format('woff'); }
@font-face { font-family: 'Shattered'; src: url('../fonts/shattered.woff') format('woff'); }
@font-face { font-family: 'Sigella'; src: url('../fonts/sigella.woff') format('woff'); }
@font-face { font-family: 'Sirkel'; src: url('../fonts/sirkel.woff') format('woff'); }
@font-face { font-family: 'Skeleton'; src: url('../fonts/skeleton.woff') format('woff'); }
@font-face { font-family: 'Soy'; src: url('../fonts/soy.woff') format('woff'); }
@font-face { font-family: 'Stereosans'; src: url('../fonts/stereosans.woff') format('woff'); }
@font-face { font-family: 'Substanta'; src: url('../fonts/substanta.woff') format('woff'); }
@font-face { font-family: 'Susle'; src: url('../fonts/susle.woff') format('woff'); }
@font-face { font-family: 'Teibifont'; src: url('../fonts/teibifont.woff') format('woff'); }
@font-face { font-family: 'Thetimesapex'; src: url('../fonts/thetimesapex.woff') format('woff'); }
@font-face { font-family: 'Tiltortion'; src: url('../fonts/tiltortion.woff') format('woff'); }
@font-face { font-family: 'Tirnotmono'; src: url('../fonts/tirnotmono.woff') format('woff'); }
@font-face { font-family: 'Toiletpapertype'; src: url('../fonts/toiletpapertype.woff') format('woff'); }
@font-face { font-family: 'Tontfont'; src: url('../fonts/tontfont.woff') format('woff'); }
@font-face { font-family: 'Tortura'; src: url('../fonts/tortura.woff') format('woff'); }
@font-face { font-family: 'Vaksal'; src: url('../fonts/vaksal.woff') format('woff'); }
@font-face { font-family: 'Varenyky'; src: url('../fonts/varenyky.woff') format('woff'); }
@font-face { font-family: 'Velodromatic'; src: url('../fonts/velodromatic.woff') format('woff'); }
@font-face { font-family: 'Volask'; src: url('../fonts/volask.woff') format('woff'); }
@font-face { font-family: 'Vorsik'; src: url('../fonts/vorsik.woff') format('woff'); }
@font-face { font-family: 'Worksanstase'; src: url('../fonts/worksanstase.woff') format('woff'); }
@font-face { font-family: 'Yoga'; src: url('../fonts/yoga.woff') format('woff'); }
@font-face { font-family: 'Zak'; src: url('../fonts/zak.woff') format('woff'); }

body { margin: 0; background-color: #fff; color: #000; overflow: hidden; height: 100vh; width: 100vw; font-family: sans-serif; touch-action: none; }
#top-bar { position: fixed; top: 30px; left: 30px; display: flex; align-items: center; gap: 20px; z-index: 5000; }
.top-left-brand { font-weight: bold; font-size: 24px; text-transform: uppercase; }
.search-container { position: relative; width: 220px; }
/* --- UPDATED INFO BOX --- */
.info-box {
    pointer-events: auto;
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start;
    max-width: 400px; /* Limits width so it doesn't hit letters */
    background: rgba(255, 255, 255, 0); /* Optional: slight blur background for readability */
    padding: 10px;
    border-radius: 15px;
}

#infoTitle {
    margin: 0 0 10px 0;
    font-size: 32px;
    text-transform: uppercase;
    line-height: 1.1;
}

#infoDescription {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.9;
    /* This ensures long text wraps correctly */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.download-trigger {
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    color: #000;
    border: 1.5px solid #000;
    padding: 8px 20px;
    border-radius: 25px;
    display: inline-block;
    transition: background 0.2s;
}

.download-trigger:hover {
    background: #000;
    color: #fff;
}
#fontSelector { border: 1.5px solid #000; border-radius: 25px; font-size: 14px; background: #fff; width: 100%; padding: 8px 15px; font-weight: bold; outline: none; }
.dropdown-content { display: none; position: absolute; top: 100%; left: 0; width: 100%; max-height: 250px; overflow-y: auto; background: #fff; border: 1px solid #000; border-radius: 15px; z-index: 6000; margin-top: 5px; }
.dropdown-content.show { display: block; }
.dropdown-item { padding: 10px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 18px; }
#alphabetContainer { position: fixed; top: 30px; right: 30px; display: flex; flex-direction: column; align-items: flex-end; z-index: 2000; pointer-events: none; }
.letter-row { display: flex; margin-bottom: 35px; }
.char-wrapper { display: inline-flex; position: relative; width: 22px; height: 40px; cursor: pointer; justify-content: center; align-items: center; pointer-events: auto; }
.char { font-size: 38px; position: absolute; pointer-events: none; }
#ui-footer { position: fixed; bottom: 30px; left: 30px; right: 30px; display: flex; justify-content: space-between; align-items: flex-end; z-index: 1500; pointer-events: none; }
.info-box, #foundry-controls { pointer-events: auto; }
#infoTitle { margin: 0 0 5px 0; font-size: 28px; text-transform: uppercase; }
#infoDescription { margin: 0 0 15px 0; font-size: 14px; opacity: 0.8; }
.download-trigger { font-size: 11px; font-weight: bold; text-decoration: none; color: #000; border: 1.5px solid #000; padding: 8px 20px; border-radius: 25px; display: inline-block; }
#foundry-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#wordSpawner { border: none; border-bottom: 2px solid black; outline: none; text-align: right; font-size: 18px; background: transparent; width: 200px; font-weight: bold; }
.slider-group { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.black-slider { -webkit-appearance: none; width: 140px; background: transparent; height: 15px; }
.black-slider::-webkit-slider-runnable-track { height: 2px; background: #000; }
.black-slider::-webkit-slider-thumb { -webkit-appearance: none; height: 12px; width: 12px; border-radius: 50%; background: #000; margin-top: -5px; }
.control-label { font-size: 10px; font-weight: bold; }
#deleteZone { position: fixed; right: 40px; top: 55%; transform: translateY(-50%); width: 60px; display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0.15; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 100; pointer-events: auto; cursor: pointer; }
.delete-label { font-size: 10px; font-weight: bold; letter-spacing: 1px; user-select: none; color: #000; }
#trashIcon { width: 40px; height: 50px; }
#deleteZone:hover, #deleteZone.hover-target { opacity: 1; transform: translateY(-50%) scale(1.3); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px); display: none; justify-content: center; align-items: center; z-index: 9000; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border: 2px solid #000; padding: 40px; border-radius: 40px; text-align: center; width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.modal-box p { font-weight: bold; font-size: 20px; margin-bottom: 30px; letter-spacing: 1px; font-family: sans-serif; }
.modal-buttons { display: flex; justify-content: center; gap: 15px; }
.modal-buttons button { background: transparent; border: 2px solid #000; padding: 12px 25px; border-radius: 30px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 13px; }
.modal-buttons button:hover { background: #000; color: #fff; }
#modalConfirm { background: #000; color: #fff; }
#canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.letter { position: absolute; cursor: grab; user-select: none; z-index: 2500; padding: 10px; will-change: transform; white-space: nowrap; pointer-events: auto; opacity: 0; }
.letter.visible { opacity: 1; }
.deleted { pointer-events: none; transition: 0.4s; transform: scale(0) rotate(45deg) !important; opacity: 0; }
@media (max-width: 768px) {
    #alphabetContainer { display: none; }
    #top-bar { top: 20px; left: 20px; width: calc(100% - 40px); }
    #ui-footer { flex-direction: column; align-items: center; bottom: 20px; left: 20px; right: 20px; gap: 25px; }
    .info-box { width: 100%; text-align: center; }
    #foundry-controls { width: 100%; align-items: center; }
    #wordSpawner { width: 100%; text-align: center; }
    .slider-group { flex-direction: row; width: 100%; justify-content: space-between; gap: 15px; }
    .black-slider { width: 100%; }
}