@font-face {
    font-family: 'G2ErikaMono';
    src: url('G2-Erika-Mono.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Offgrid';
    src: url('250526_Offgrid_Variable_WIDTH_AXIS_FOR_WEBVF.ttf') format('truetype-variations');
    font-weight: 99 200;
    font-stretch: 99% 200%;
    font-variation-settings: 'slnt' 0;
}

@font-face {
    font-family: 'OffgridRounded';
    src: url('250605Offgrid-variableROUNDEDVF.ttf') format('truetype-variations');
    font-weight: 99 200;
    font-stretch: 99% 200%;
    font-variation-settings: 'slnt' 0;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    font-family: 'Offgrid', sans-serif;
    color: #fff;
    overflow: hidden;
}

.controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 42, 42, 0.85);
    padding: 24px 32px;
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    z-index: 1000;
    display: flex;
    gap: 80px;
    text-transform: uppercase;
    user-select: none;
    -webkit-user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: none;
}

.controls.hidden {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Add new styles for fullscreen mode */
body:fullscreen .controls,
body:-webkit-full-screen .controls {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Add transition for entering/exiting fullscreen */
body:fullscreen .controls,
body:-webkit-full-screen .controls,
body:fullscreen .controls.hidden,
body:-webkit-full-screen .controls.hidden {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group h3 {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: normal;
    height: 20px;
    display: flex;
    align-items: center;
    border: none;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.control-group:first-child .control-row:first-child {
    margin-top: 0;
}

.control-group:first-child .control-row:first-child label {
    margin-top: 0;
}

.control-group:first-child .control-row:first-child input[type="range"] {
    margin-top: 0;
}

.control-group:first-child .control-row:first-child span {
    margin-top: 0;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 26px;
    height: 20px;
}

.control-row label {
    width: 41px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: normal;
    user-select: none;
    -webkit-user-select: none;
}

/* Remove the special case for combined controls row since we now have consistent spacing */
.control-row:has(.curve-selector) {
    gap: 26px;
}

input[type="range"] {
    width: 139px;
    height: 4px;
    -webkit-appearance: none;
    background: #404040;
    border-radius: 2px;
    outline: none;
    transition: none;
    margin: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    transition: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #FFFFFF;
}

input[type="color"] {
    width: 40px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

#textSizeValue {
    display: none;
}

.input-container {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1000;
}

input[type="text"] {
    font-size: 1.5rem;
    padding: 12px;
    background: rgba(42, 42, 42, 0.95);
    border: none;
    color: #fff;
    outline: none;
    text-align: center;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    font-family: 'Offgrid', sans-serif;
}

.text-container {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: text;
    overflow: hidden;
    padding: 2rem;
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
    padding-top: 4rem;
}

.text-container.image-mode {
    width: min(80vh, 1080px);
    height: min(80vh, 1080px);
    margin: auto;
    position: relative;
    z-index: 2;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.text-container.image-mode .text-layer {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.text-container.image-mode .text-layer div {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.text-container.image-mode .text-layer span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
    line-height: 0.95;
}

/* Ensure text stays within bounds when using transform */
.text-container.image-mode .text-layer[style*="transform"] {
    width: 100%;
    height: 100%;
    overflow: hidden;
    transform-origin: center center;
}

.controls.hidden ~ .text-container {
    transform: translateY(-80px);
}

.controls.hidden ~ .export-button,
.controls.hidden ~ .export-options {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.controls.hidden ~ .text-container.image-mode ~ .export-button,
.controls.hidden ~ .text-container.image-mode ~ .export-options {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

.export-button,
.export-options {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.text-layer {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -45%);
    font-size: 5rem;
    white-space: pre-wrap;
    transition: font-weight 0.5s ease, font-size 0.3s ease;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    max-width: 95vw;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 0.95;
    text-align: center;
    --weight-duration: 3s;
    --width-duration: 3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-layer::selection {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.text-layer.layer-1::selection {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

.text-layer.layer-2::selection {
    background: rgba(255, 0, 255, 0.2);
    color: #ff00ff;
}

.text-layer.layer-3::selection {
    background: rgba(255, 255, 0, 0.2);
    color: #ffff00;
}

.text-layer span {
    display: inline-block;
    white-space: pre-wrap;
    text-align: center;
}

.text-layer span::selection {
    background: inherit;
    color: inherit;
}

.text-layer.sequential {
    line-height: 0.95;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.text-layer.sequential span {
    animation: weightAnimation var(--weight-duration) infinite,
               widthAnimation var(--width-duration) infinite;
    line-height: 0.95;
    margin: 0;
    padding: 0;
}

.text-layer.simultaneous {
    animation: weightAnimation var(--weight-duration) infinite,
               widthAnimation var(--width-duration) infinite;
}

.text-layer.color-animation.sequential {
    line-height: 0.95;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.text-layer.color-animation.sequential span {
    animation: weightAnimation var(--weight-duration) infinite,
               widthAnimation var(--width-duration) infinite,
               colorAnimation 3s infinite;
    line-height: 0.95;
    margin: 0;
    padding: 0;
}

.layer-1 {
    animation-delay: 0s;
}

.layer-2 {
    animation-delay: 0.5s;
}

.layer-3 {
    animation-delay: 0.4s;
}

@keyframes weightAnimation {
    0% { font-weight: 101; }
    50% { font-weight: 200; }
    100% { font-weight: 101; }
}

@keyframes widthAnimation {
    0% { font-stretch: 101%; }
    50% { font-stretch: 200%; }
    100% { font-stretch: 101%; }
}

@keyframes colorAnimation {
    0% { color: var(--color-1); }
    50% { color: var(--color-2); }
    100% { color: var(--color-1); }
}

.text-layer.color-animation {
    --color-1: currentColor;
    --color-2: currentColor;
}

.text-layer.color-animation.layer-1 {
    --color-1: var(--layer-1-color);
    --color-2: var(--layer-2-color);
}

.text-layer.color-animation.layer-2 {
    --color-1: var(--layer-2-color);
    --color-2: var(--layer-3-color);
}

.text-layer.color-animation.layer-3 {
    --color-1: var(--layer-3-color);
    --color-2: var(--layer-1-color);
}

.mode-dot,
.shadow-dot,
.multiply-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    position: relative;
}

.mode-dot:hover,
.shadow-dot:hover,
.multiply-dot:hover {
    transform: scale(1.2);
    background: #666;
}

.mode-dot.selected,
.shadow-dot.selected,
.multiply-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}

.color-dot-wrapper {
    width: auto;
    height: 20px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 8px;
    margin: -8px;
}

.color-dot-wrapper .color-dot {
    min-width: 30px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-sizing: border-box;
}

.color-dot-wrapper .color-dot:hover {
    transform: scale(1.1);
    background: #666;
    color: #fff;
}

.color-dot-wrapper .color-dot.selected {
    border: 1px solid #fff;
    background: #fff;
    color: #222;
}

.color-picker-container {
    position: absolute;
    top: calc(100% + 26px);
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    background: rgba(42, 42, 42, 0.85);
    padding: 12px;
    border-radius: 8px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    width: 180px;
}

.color-picker-container.active {
    opacity: 1;
    visibility: visible;
}

.color-picker-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-slider {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-slider label {
    width: 16px;
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
}

.color-slider input[type="range"] {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #404040;
    border-radius: 2px;
    outline: none;
    transition: none;
    margin: 0;
}

/* Image mode specific color picker styles */
body:has(.text-container.image-mode) .color-picker-container {
    width: 160px;
    padding: 10px;
    top: auto;
    left: auto;
    right: calc(100% + 6px);
    bottom: 6px;
    transform: none;
}

body:has(.text-container.image-mode) .color-picker-controls {
    gap: 6px;
}

body:has(.text-container.image-mode) .color-slider {
    gap: 4px;
}

body:has(.text-container.image-mode) .color-slider label {
    width: 14px;
    font-size: 10px;
}

body:has(.text-container.image-mode) .color-slider input[type="range"] {
    height: 3px;
}

body:has(.text-container.image-mode) .color-slider input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
}

.color-slider input[type="text"] {
    width: 40px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: center;
}

.hex-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hex-input label {
    width: 20px;
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
}

.hex-input input {
    flex-grow: 1;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: center;
}

.color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.color-dots {
    display: flex;
    gap: 8px;
}

.mode-selector,
.shadow-toggle,
.multiply-toggle,
.curve-selector,
.color-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100px;
}

.mode-selector label,
.shadow-toggle label,
.multiply-toggle label,
.curve-selector label,
.color-toggle label {
    width: auto;
    min-width: 40px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: normal;
    margin: 0;
}

.curve-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid transparent;
    background: #404040;
    position: relative;
}

.curve-dot:hover {
    transform: scale(1.2);
}

.curve-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}

.speed-dots {
    display: flex;
    gap: 8px;
}

.speed-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid transparent;
    background: #404040;
    position: relative;
}

.speed-dot:hover {
    transform: scale(1.2);
}

.speed-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}

.speed-dot.filled {
    background: #fff;
    border: 1px solid #fff;
}

/* Export button styles */
/*
.export-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(42, 42, 42, 0.85);
    border: none;
    color: #999;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.export-button:hover {
    color: #fff;
    background: rgba(42, 42, 42, 0.95);
}

.export-button.loading {
    pointer-events: none;
}

.export-button.loading span {
    display: inline-block;
    animation: letterPulse 1.5s infinite;
}

.export-button.loading span:nth-child(1) { animation-delay: 0.0s; }
.export-button.loading span:nth-child(2) { animation-delay: 0.1s; }
.export-button.loading span:nth-child(3) { animation-delay: 0.2s; }
.export-button.loading span:nth-child(4) { animation-delay: 0.3s; }
.export-button.loading span:nth-child(5) { animation-delay: 0.4s; }
.export-button.loading span:nth-child(6) { animation-delay: 0.5s; }

@keyframes letterPulse {
    0%, 100% { color: #999; }
    50% { color: #fff; }
}

.export-options {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background: rgba(42, 42, 42, 0.85);
    padding: 8px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.export-options.show {
    display: flex;
}

.export-option {
    background: none;
    border: none;
    color: #999;
    padding: 8px;
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: color 0.3s ease;
}

.export-option:hover {
    color: #fff;
}
*/

/* Record button styles */
/*
.record-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    position: relative;
}

.record-dot:hover {
    transform: scale(1.2);
    background: #666;
}

.record-dot.selected {
    border: 1px solid #ff4444;
    background: #ff4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
*/

.visibility-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.visibility-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid transparent;
    background: #404040;
    position: relative;
}

.visibility-dot:hover {
    transform: scale(1.2);
}

.visibility-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}

.layer-header {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    height: 20px;
}

.layer-toggle {
    margin: 0;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: normal;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    padding-left: 20px;
}

.layer-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #404040;
    transition: background-color 0.2s ease;
}

.layer-toggle:hover {
    color: #fff;
}

.layer-toggle:hover::before {
    background: #666;
}

.layer-toggle.active {
    color: #fff;
}

.layer-toggle.active::before {
    background: #fff;
}

.state-value {
    width: auto;
    min-width: 30px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-sizing: border-box;
}

.state-value:hover {
    transform: scale(1.1);
    background: #666;
    color: #fff;
}

/* Color toggle styles */
.color-toggle {
    display: flex;
    align-items: center;
    gap: 2.5px;
}

.color-toggle .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    position: relative;
    min-width: auto;
    padding: 0;
}

.color-toggle .color-dot:hover {
    transform: scale(1.2);
    background: #666;
}

.color-toggle .color-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}

.bg-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100px;
}

.bg-toggle label {
    width: auto;
    min-width: 40px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: normal;
    margin: 0;
}

.bg-toggle .color-dot-wrapper {
    width: auto;
    height: 20px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 8px;
    margin: -8px;
}

.bg-toggle .color-dot-wrapper .color-dot {
    width: 14px;
    height: 14px;
    min-width: auto;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.bg-toggle .color-dot-wrapper .color-dot:hover {
    transform: scale(1.2);
    background: #666;
    color: #fff;
}

.bg-toggle .color-dot-wrapper .color-dot.selected {
    border: 1px solid #fff;
    background: #fff;
    color: #222;
}

.bg-toggle .color-dot-wrapper .color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.image-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(42, 42, 42, 0.85);
    padding: 32px;
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    width: 200px;
    display: none;
    user-select: none;
    -webkit-user-select: none;
}

.image-controls * {
    user-select: none;
    -webkit-user-select: none;
}

.image-controls input[type="range"] {
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.image-controls button {
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.image-controls .pattern-dot,
.image-controls .alignment-dot {
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.image-controls.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-controls .image-control-group {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
}

/* Remove image toggle styles */
.image-toggle {
    display: none;
}

.image-dot {
    display: none;
}

.image-upload-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    height: auto;
}

.image-upload-row.active,
.image-pick-colors-row.active,
.image-blur-row.active,
.image-dot-size-row.active {
    opacity: 1;
    visibility: visible;
}

.upload-button {
    width: 100%;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'G2ErikaMono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
    height: auto;
}

.upload-button:hover,
.pick-colors-button:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Remove dot size control styles */
.dot-size-control {
    display: none;
}

/* Remove text size control styles */
.text-size-control {
    display: none;
}

/* Add blur amount slider styles */
.blur-control {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.blur-control label {
    width: 40px;
    color: #999;
    text-transform: uppercase;
    font-size: 12px;
    flex-shrink: 0;
}

.blur-control input[type="range"] {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #404040;
    border-radius: 2px;
    outline: none;
    transition: all 0.3s ease;
    margin: 0;
}

.blur-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.blur-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #FFFFFF;
}

/* Remove effect toggle styles */
.effect-toggle {
    display: none;
}

.effect-dot {
    display: none;
}

.canvas-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vh, 1080px);
    height: min(80vh, 1080px);
    display: none;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    overflow-x: hidden;
    overflow-y: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.canvas-container.active {
    display: block;
}

#imageCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* When image mode is active, constrain text container */
.text-container.image-mode {
    width: min(80vh, 1080px);
    height: min(80vh, 1080px);
    margin: auto;
    position: relative;
    z-index: 2;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-dot,
.effect-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    position: relative;
}

.image-dot:hover,
.effect-dot:hover {
    transform: scale(1.2);
    background: #666;
}

.image-dot.selected,
.effect-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}

/* Remove zoom input styles */
#zoomInput {
    display: none;
}

.text-position-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: rgba(42, 42, 42, 0.85);
    border-radius: 8px;
    margin-top: 0;
}

.text-alignment-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.text-alignment-control label {
    width: 40px;
    color: #999;
    text-transform: uppercase;
    font-size: 12px;
}

.alignment-dots {
    display: flex;
    margin-left: auto;
    gap: 8px;
}

.alignment-dot {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'G2ErikaMono', monospace;
}

.alignment-dot:hover {
    transform: scale(1.1);
    background: #666;
    color: #fff;
}

.alignment-dot.selected {
    border: 1px solid #fff;
    background: #fff;
    color: #222;
}

.text-offset-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.text-offset-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.text-offset-control label {
    width: 20px;
    color: #999;
    text-transform: uppercase;
    font-size: 12px;
    flex-shrink: 0;
}

.text-offset-control input[type="range"] {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #404040;
    border-radius: 2px;
    outline: none;
    transition: none;
    margin: 0;
    width: 100%;
}

.text-offset-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-offset-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #FFFFFF;
}

/* Add new styles for image mode controls */
.text-container.image-mode ~ .controls {
    top: 50%;
    left: auto;
    right: 20px;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 40px;
    padding: 32px 24px;
    max-height: 90vh;
    overflow-y: auto;
}

.text-container.image-mode ~ .controls .control-group {
    width: 200px;
}

.text-container.image-mode ~ .controls .control-row {
    width: 100%;
    justify-content: space-between;
}

.text-container.image-mode ~ .controls .mode-selector,
.text-container.image-mode ~ .controls .curve-selector,
.text-container.image-mode ~ .controls .multiply-toggle,
.text-container.image-mode ~ .controls .color-toggle,
.text-container.image-mode ~ .controls .shadow-toggle,
.text-container.image-mode ~ .controls .bg-toggle {
    width: 100%;
    justify-content: space-between;
}

.text-container.image-mode ~ .controls input[type="range"] {
    width: 100%;
}

/* Hide controls when image controls are active */
.text-container.image-mode ~ .controls.hidden {
    transform: translateY(-50%) translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Image mode controls */
body:has(.text-container.image-mode) .controls {
    top: 20px;
    left: auto;
    right: 20px;
    transform: none;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    width: 208px;
    transition: none;
}

body:has(.text-container.image-mode) .controls .control-group {
    width: 100%;
}

body:has(.text-container.image-mode) .controls .control-row {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 0;
    height: auto;
}

body:has(.text-container.image-mode) .controls .mode-selector,
body:has(.text-container.image-mode) .controls .curve-selector,
body:has(.text-container.image-mode) .controls .multiply-toggle,
body:has(.text-container.image-mode) .controls .color-toggle,
body:has(.text-container.image-mode) .controls .shadow-toggle,
body:has(.text-container.image-mode) .controls .bg-toggle {
    width: 100%;
    justify-content: space-between;
}

body:has(.text-container.image-mode) .controls input[type="range"] {
    width: 100%;
}

/* Hide controls when image controls are active */
body:has(.text-container.image-mode) .controls.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-position-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 176px;
    padding: 12px;
    background: rgba(42, 42, 42, 0.85);
    border-radius: 8px;
    margin-top: 0;
}

.image-position-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.image-position-control label {
    width: 20px;
    color: #999;
    text-transform: uppercase;
    font-size: 12px;
    flex-shrink: 0;
}

.image-position-control input[type="range"] {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #404040;
    border-radius: 2px;
    outline: none;
    transition: none;
    margin: 0;
    width: 100%;
}

.image-position-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: none;
}

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

.image-pattern-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}


.image-pattern-row.active {
    opacity: 1;
    visibility: visible;
}

.pattern-control {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.pattern-control label {
    width: 40px;
    color: #999;
    text-transform: uppercase;
    font-size: 12px;
    flex-shrink: 0;
}

.pattern-dots {
    display: flex;
    gap: 8px;
}

.pattern-dot {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #404040;
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'G2ErikaMono', monospace;
}




.pattern-dot:hover {
    transform: scale(1.1);
    background: #666;
    color: #fff;
}

.pattern-dot.selected {
    border: 1px solid #fff;
    background: #fff;
    color: #222;
}

.rasterization-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 176px;
    padding: 12px;
    background: rgba(42, 42, 42, 0.85);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rasterization-controls.active {
    opacity: 1;
    visibility: visible;
}

.rasterization-controls .control-row {
    margin: 0;
    height: auto;
}

.rasterization-controls .blur-control,
.rasterization-controls .pattern-control {
    width: 100%;
    margin: 0;
}

.rasterization-controls label {
    width: 40px;
    color: #999;
    text-transform: uppercase;
    font-size: 12px;
    flex-shrink: 0;
}

.rasterization-controls input[type="range"] {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #404040;
    border-radius: 2px;
    outline: none;
    transition: none;
    margin: 0;
    width: 100%;
}

.rasterization-controls .pattern-dots {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.multiply-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100px;
}

.rounded-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100px;
}

.multiply-toggle label,
.rounded-toggle label {
    width: auto;
    min-width: 40px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: normal;
    margin: 0;
}

.multiply-dot,
.rounded-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 1px solid transparent;
    background: #404040;
    position: relative;
}

.multiply-dot:hover,
.rounded-dot:hover {
    transform: scale(1.2);
    background: #666;
}

.multiply-dot.selected,
.rounded-dot.selected {
    border: 1px solid #fff;
    background: #fff;
}