* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #272727;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Arial Black', 'Arial Bold', Gadget, sans-serif;
}

.stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: right;
    font-size: 11rem;
    line-height: .82;
    font-weight: 900;
    letter-spacing: -2px;
    color: #fff;
    text-transform: uppercase;
    transition: filter 0.15s ease, font-size 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.line-1 {
    padding-right: 4px;
}

.line-2 {
    padding-right: 4px;
}

.line-1:empty,
.line-2:empty {
    display: none;
}

.popup-menu {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(20 20 20 / .85);
    backdrop-filter: blur(6px);
    border-radius: 60px;
    padding: .6rem 1.2rem;
    display: flex;
    gap: .3rem;
    border: 1px solid rgb(255 255 255 / .08);
    z-index: 999;
    user-select: none;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    letter-spacing: .3px;
}

.popup-menu button {
    background: #fff0;
    border: none;
    color: #ccc;
    font-size: .8rem;
    font-weight: 700;
    padding: .4rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: inherit;
    width: 40px;
    height: 40px;
}

.popup-menu button:hover {
    background: rgb(255 255 255 / .08);
    color: #fff;
}

.popup-menu button.active {
    background: #000;
    color: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / .3);
}

.popup-menu button span {
    position: relative;
    left: -2px;
}

.text-panel-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgb(20 20 20 / .8);
    backdrop-filter: blur(6px);
    border: 1px solid rgb(255 255 255 / .1);
    border-radius: 40px;
    color: #eee;
    font-size: 1.1rem;
    padding: .5rem 1.2rem;
    cursor: pointer;
    z-index: 1000;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    letter-spacing: .5px;
    transition: 0.2s;
    user-select: none;
}

.text-panel-toggle:hover {
    background: rgb(40 40 40 / .9);
    color: #fff;
}

.text-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 370px;
    max-width: 94vw;
    height: 100vh;
    background: rgb(15 15 15 / .94);
    backdrop-filter: blur(14px);
    border-left: 1px solid rgb(255 255 255 / .08);
    padding: 2rem 1.5rem;
    z-index: 1001;
    transform: translateX(110%);
    transition: transform 0.35s cubic-bezier(.22, 1, .36, 1);
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: #eee;
    overflow-y: auto;
}

.text-panel.open {
    transform: translateX(0%);
}

.text-panel h3 {
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: .2rem;
    font-weight: 400;
    border-bottom: 1px solid rgb(255 255 255 / .06);
    padding-bottom: .6rem;
}

.text-panel .field-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.text-panel label {
    font-size: .7rem;
    letter-spacing: 1px;
    color: #888;
    text-transform: uppercase;
}

.text-panel input[type="text"] {
    background: rgb(255 255 255 / .06);
    border: 1px solid rgb(255 255 255 / .12);
    border-radius: 30px;
    padding: .7rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    text-transform: uppercase;
    outline: none;
    transition: 0.2s;
    letter-spacing: .5px;
}

.text-panel input[type="text"]:focus {
    border-color: rgb(255 255 255 / .4);
    background: rgb(255 255 255 / .08);
}

.text-panel input[type="text"]::placeholder {
    color: #555;
    font-weight: 400;
    letter-spacing: .3px;
}

.size-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .2rem 0;
}

.size-control input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgb(255 255 255 / .15);
    outline: none;
    transition: 0.2s;
}

.size-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgb(0 0 0 / .4);
}

.size-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

.size-control .size-value {
    min-width: 3.8rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: rgb(255 255 255 / .06);
    padding: .3rem .6rem;
    border-radius: 30px;
    letter-spacing: .5px;
}

.color-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-control .color-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgb(255 255 255 / .2);
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.2s;
    background: #000;
}

.color-control .color-preview:hover {
    border-color: rgb(255 255 255 / .5);
    transform: scale(1.05);
}

.color-control .color-hex {
    font-size: .8rem;
    color: #aaa;
    font-weight: 400;
    letter-spacing: .5px;
    font-family: monospace;
    background: rgb(255 255 255 / .05);
    padding: .3rem .8rem;
    border-radius: 20px;
}

.color-picker-container {
    position: relative;
    margin-top: .2rem;
}

.color-picker {
    display: none;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 30px rgb(0 0 0 / .6);
    user-select: none;
    z-index: 1002;
    width: fit-content;
    margin: 0 auto;
}

.color-picker.visible {
    display: block;
}

.color-square {
    position: relative;
    width: 156px;
    height: 156px;
    overflow: hidden;
    outline: 1px solid #555;
    cursor: crosshair;
    float: left;
    border-radius: 4px;
}

.color-overlay1,
.color-overlay2 {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.color-overlay1 {
    background: linear-gradient(to right, white 0%, #fff0 100%);
}

.color-overlay2 {
    background: linear-gradient(to bottom, #fff0 0%, black 100%);
}

.color-selector-outer {
    position: absolute;
    width: 11px;
    height: 11px;
    margin: -6px 0 0 -6px;
    border: 1px solid #000;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

.color-selector-inner {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid #FFF;
    border-radius: 50%;
    pointer-events: none;
}

.hue-bar {
    position: relative;
    width: 20px;
    height: 156px;
    border: 1px solid #555;
    cursor: ns-resize;
    float: left;
    margin-left: 12px;
    border-radius: 4px;
    background: linear-gradient(to bottom, #ff0000 0%, #ff0080 8.33%, #ff00ff 16.67%, #8000ff 25%, #0000ff 33.33%, #0080ff 41.67%, #00ffff 50%, #00ff80 58.33%, #00ff00 66.67%, #80ff00 75%, #ffff00 83.33%, #ff8000 91.67%, #ff0000 100%);
}

.hue-selector {
    position: absolute;
    width: 100%;
    height: 7px;
    margin: -3.5px 0 0 0;
    pointer-events: none;
    left: 0;
    z-index: 10;
}

.hue-arrow-left,
.hue-arrow-right {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 6px solid #fff0;
    border-bottom: 6px solid #fff0;
}

.hue-arrow-left {
    left: -7px;
    border-left: 7px solid #858585;
}

.hue-arrow-right {
    right: -7px;
    border-right: 7px solid #858585;
}

.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

.text-panel .action-row {
    display: flex;
    gap: .6rem;
    margin-top: .2rem;
    flex-wrap: wrap;
}

.text-panel .action-row button {
    flex: 1;
    background: rgb(255 255 255 / .07);
    border: 1px solid rgb(255 255 255 / .1);
    border-radius: 40px;
    padding: .6rem 1rem;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    font-size: .7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
}

.text-panel .action-row button:hover {
    background: rgb(255 255 255 / .15);
    color: #fff;
}

.text-panel .action-row button.primary {
    background: #fff;
    color: #111;
    border-color: #fff;
}

.text-panel .action-row button.primary:hover {
    background: #ddd;
    border-color: #ddd;
}

.text-panel .close-panel {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: #777;
    font-size: 1.6rem;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    padding: 0 .2rem;
}

.text-panel .close-panel:hover {
    color: #fff;
    transform: rotate(90deg);
}

.divider {
    border: none;
    border-top: 1px solid rgb(255 255 255 / .06);
    margin: .2rem 0 .6rem 0;
}

@media (max-width:700px) {
    .container {
        font-size: 4.5rem;
        line-height: .78;
    }

    .popup-menu {
        bottom: 1.5rem;
        padding: .4rem .8rem;
        gap: .1rem;
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 40px;
        max-width: 95%;
    }

    .popup-menu button {
        font-size: .6rem;
        padding: .3rem .7rem;
        width: 36px;
        height: 36px;
    }

    .text-panel {
        width: 310px;
        padding: 1.8rem 1rem;
    }

    .text-panel-toggle {
        top: 1rem;
        right: 1rem;
        font-size: .8rem;
        padding: .3rem 1rem;
    }

    .size-control .size-value {
        min-width: 3rem;
        font-size: .85rem;
    }

    .color-square {
        width: 130px;
        height: 130px;
    }

    .hue-bar {
        height: 130px;
    }

    .color-picker {
        padding: 8px;
    }
}

@media (max-width:450px) {
    .container {
        font-size: 3.2rem;
        line-height: .75;
    }

    .popup-menu button {
        font-size: .5rem;
        padding: .2rem .5rem;
        width: 32px;
        height: 32px;
    }

    .text-panel {
        width: 270px;
        padding: 1.5rem .8rem;
    }

    .color-square {
        width: 110px;
        height: 110px;
    }

    .hue-bar {
        height: 110px;
        width: 16px;
    }
}

.copy {
    position: fixed;
    top: 20px;
    left: 20px;
    color: #fff;
    background: rgb(0 0 0 / .7);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 2;
}

/* ESTILOS GENERICOS */
html {
    -webkit-text-size-adjust: 100%;

    /* evita que iOS agrande el texto al rotar */
}

body {
    overscroll-behavior: none;

    /* evita pull-to-refresh accidental */
}

* {
    -webkit-tap-highlight-color: transparent;

    /* quita el flash azul al tocar en iOS */
}

.text-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    font-family: 'Arial Black', 'Arial Bold', Gadget, sans-serif;
    font-weight: 900;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    fill: #fff;
    display: block;
}

.text-line {
    fill: #fff;
}

/* ==========================================
   COMPATIBILIDAD PARA IPHONE E IPAD
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    .stage {
        position: relative;
        width: 100%;
        min-width: 0;
    }

    .container {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        visibility: visible !important;
        opacity: 1 !important;
        color: #fff !important;
        -webkit-filter: none !important;
        filter: none !important;
        max-width: 100%;
    }

    .line-1,
    .line-2 {
        display: block;
        color: #fff !important;
        -webkit-text-fill-color: #fff;
    }

    .popup-menu {
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .popup-menu button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        -webkit-appearance: none;
        appearance: none;
        color: #ccc;
        background: transparent;
        border: none;
        touch-action: manipulation;
    }

    .popup-menu button.active {
        color: #fff;
        background: #000;
    }

    .text-panel-toggle {
        z-index: 10000;
        -webkit-appearance: none;
        appearance: none;
    }
}

/* ESTILOS GENERICOS */
html {
    -webkit-text-size-adjust: 100%;

    /* evita que iOS agrande el texto al rotar */
}

body {
    overscroll-behavior: none;

    /* evita pull-to-refresh accidental */
}

* {
    -webkit-tap-highlight-color: transparent;

    /* quita el flash azul al tocar en iOS */
}

/* ==========================================
   TRAUMA-XP — INTERACTION GUIDE
========================================== */
#xp-interaction-guide {
    position: fixed;
    left: 40px;
    bottom: 40px;
    z-index: 999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Poppins', sans-serif;
}

/* TYPOGRAPHY */
#xp-interaction-guide .xp-guide-words {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: inherit;
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.06em;
}

#xp-interaction-guide .xp-guide-words span {
    display: block;
    font-family: inherit;
    font-weight: 900;
    color: #fff;
}

#xp-interaction-guide .xp-guide-words span:first-child {
    color: #0062ff;
}

/* DESCRIPTION */
#xp-interaction-guide p {
    margin: 18px 0 0;
    font-family: inherit;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    #xp-interaction-guide {
        left: 20px;
        bottom: 24px;
    }

    #xp-interaction-guide .xp-guide-words {
        font-size: clamp(32px, 8vw, 38px);
    }

    #xp-interaction-guide p {
        font-size: 8px;
        max-width: 230px;
    }
}