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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.site-logo {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    font-weight: 400;
    margin: 0;
    padding: 0;
    line-height: 1;
    cursor: default;
    user-select: none;
}

.logo-stunning {
    color: #4ecdc4;
    text-shadow:
        1px 1px 0px rgba(13, 93, 86, 0.9),
        2px 2px 0px rgba(13, 93, 86, 0.85),
        3px 3px 0px rgba(13, 93, 86, 0.8),
        4px 4px 0px rgba(13, 93, 86, 0.75),
        5px 5px 0px rgba(13, 93, 86, 0.7),
        6px 6px 0px rgba(13, 93, 86, 0.65),
        7px 7px 0px rgba(13, 93, 86, 0.6),
        8px 8px 0px rgba(13, 93, 86, 0.55),
        9px 9px 0px rgba(13, 93, 86, 0.5),
        10px 10px 0px rgba(13, 93, 86, 0.45),
        0 0 10px rgba(78, 205, 196, 0.5),
        0 0 20px rgba(78, 205, 196, 0.3),
        0 0 30px rgba(78, 205, 196, 0.2);
}

.logo-font {
    color: #ff6b6b;
    text-shadow:
        1px 1px 0px rgba(153, 27, 27, 0.9),
        2px 2px 0px rgba(153, 27, 27, 0.85),
        3px 3px 0px rgba(153, 27, 27, 0.8),
        4px 4px 0px rgba(153, 27, 27, 0.75),
        5px 5px 0px rgba(153, 27, 27, 0.7),
        6px 6px 0px rgba(153, 27, 27, 0.65),
        7px 7px 0px rgba(153, 27, 27, 0.6),
        8px 8px 0px rgba(153, 27, 27, 0.55),
        9px 9px 0px rgba(153, 27, 27, 0.5),
        10px 10px 0px rgba(153, 27, 27, 0.45),
        0 0 10px rgba(255, 107, 107, 0.5),
        0 0 20px rgba(255, 107, 107, 0.3),
        0 0 30px rgba(255, 107, 107, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    color: #aaa;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.controls-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

.controls-section::-webkit-scrollbar {
    width: 8px;
}

.controls-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.controls-section::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 10px;
}

.controls-section::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.7);
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4ecdc4;
}

#textInput {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s, background 0.3s;
}

#textInput:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(255, 255, 255, 0.12);
}

.style-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

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

.control-group > label {
    font-weight: 600;
    color: #4ecdc4;
    font-size: 0.9rem;
}

.button-group {
    display: flex;
    gap: 10px;
}

.style-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-btn:hover {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
    transform: translateY(-2px);
}

.style-btn.active {
    background: #4ecdc4;
    border-color: #4ecdc4;
    color: #1a1a2e;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.color-hex {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #aaa;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
}

.transparent-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.subselection-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.input-range-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.small-label {
    font-size: 0.85rem;
    color: #aaa;
}

.small-input {
    width: 60px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
}

.small-input:focus {
    outline: none;
    border-color: #4ecdc4;
}

.apply-btn {
    padding: 6px 12px;
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid #4ecdc4;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.apply-btn:hover {
    background: rgba(78, 205, 196, 0.3);
    transform: translateY(-1px);
}

.transparent-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.transparent-btn.active {
    background: #4ecdc4;
    border-color: #4ecdc4;
    color: #1a1a2e;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4ecdc4;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

.range-value {
    font-size: 0.9rem;
    color: #4ecdc4;
    font-weight: 600;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4ecdc4;
}

.control-group label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    color: #eee;
    font-weight: 500;
}

.download-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.download-btn {
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

.preview-section {
    min-width: 0;
}

.preview-section h2 {
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #4ecdc4;
}

.font-grid {
    display: grid;
    gap: 20px;
}

.font-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.font-preview-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(78, 205, 196, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.font-preview-card.selected {
    border: 2px solid #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.font-name {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.font-text {
    font-size: 48px;
    word-wrap: break-word;
    line-height: 1.4;
    transition: all 0.3s;
    color: #ffffff;
}

.selection-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #4ecdc4;
    color: #1a1a2e;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s;
}

.font-preview-card.selected .selection-badge {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
}

.modal-header h2 {
    margin: 0;
    color: #4ecdc4;
    font-size: 1.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #4ecdc4;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-body pre {
    background: #0d0d1a;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
    color: #4ecdc4;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid rgba(78, 205, 196, 0.3);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(78, 205, 196, 0.2);
    display: flex;
    justify-content: flex-end;
}

.copy-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn svg {
    flex-shrink: 0;
}

@media (max-width: 968px) {
    body {
        padding: 10px;
    }
    
    .site-logo {
        font-size: 2.5rem;
    }
    
    .logo-stunning, .logo-font {
        text-shadow:
            1px 1px 0px rgba(13, 93, 86, 0.9),
            2px 2px 0px rgba(13, 93, 86, 0.85),
            3px 3px 0px rgba(13, 93, 86, 0.8),
            4px 4px 0px rgba(13, 93, 86, 0.75),
            5px 5px 0px rgba(13, 93, 86, 0.7),
            0 0 10px currentColor;
    }
    
    header {
        margin-bottom: 20px;
        padding: 20px 15px;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .controls-section {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding: 20px;
    }
    
    .control-group {
        margin-bottom: 20px;
    }
    
    .control-group label {
        font-size: 0.95rem;
    }
    
    .style-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 1rem;
    }
    
    .apply-btn, .transparent-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .download-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
        min-height: 48px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .download-section br {
        display: none;
    }
    
    input[type="range"] {
        height: 32px;
    }
    
    input[type="color"] {
        width: 50px;
        height: 44px;
    }
    
    input[type="number"] {
        min-height: 44px;
        padding: 8px;
    }
    
    textarea {
        font-size: 16px;
        min-height: 80px;
    }
    
    .font-text {
        font-size: 32px;
        padding: 20px;
    }
    
    .preview-section h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .font-preview-card {
        padding: 20px;
    }
    
    .font-name {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-body pre {
        font-size: 0.75rem;
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px 20px;
    }
    
    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .site-logo {
        font-size: 2rem;
    }
    
    .logo-stunning, .logo-font {
        text-shadow:
            1px 1px 0px rgba(13, 93, 86, 0.8),
            2px 2px 0px rgba(13, 93, 86, 0.6),
            3px 3px 0px rgba(13, 93, 86, 0.4),
            0 0 8px currentColor;
    }
    
    header {
        padding: 15px 10px;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .controls-section {
        padding: 15px;
    }
    
    .control-group {
        margin-bottom: 18px;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .subselection-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .input-range-group {
        width: 100%;
    }
    
    .color-picker-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .font-text {
        font-size: 28px;
        padding: 15px;
    }
    
    .modal-body pre {
        font-size: 0.7rem;
    }
}

footer {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-top: 2px solid rgba(78, 205, 196, 0.3);
    margin-top: 60px;
}

footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 10px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

footer p:first-child {
    color: #4ecdc4;
    font-weight: 600;
    font-size: 1rem;
}

footer a {
    color: #4ecdc4;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

footer a:hover {
    color: #5ff0e0;
    border-bottom-color: #4ecdc4;
}
