@import url("https://www.nerdfonts.com/assets/css/webfont.css");

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

:root {
    color-scheme: light dark;
    --primary: #505050;
    --primary-light: #707070;
    --secondary: #303030;
    --accent: #667eea;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #333;
    --text-light: #666;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #404040;
        --primary-light: #606060;
        --secondary: #202020;
        --bg-light: #1a1a1a;
        --bg-white: #252525;
        --text-dark: #e0e0e0;
        --text-light: #999;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #111;
    }
}

.milestone-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    text-align: center;
    padding: 15px 20px;
    font-size: 22px;
    font-weight: 700;
    z-index: 99999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: milestoneSlide 0.5s ease;
}

@keyframes milestoneSlide {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

.extension-buttons-pc {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    background: var(--bg-white);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
}

@media (min-width: 769px) {
    .extension-buttons-pc {
        display: block;
    }
}

.ext-btn-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ext-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.ext-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ext-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.shortcuts-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9997;
}

.shortcuts-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    cursor: help;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    transition: all 0.3s ease;
}

.shortcuts-icon:hover {
    transform: scale(1.1);
}

.shortcuts-icon:hover + .shortcuts-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-10px);
}

.shortcuts-tooltip {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: var(--bg-white);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.shortcuts-tooltip strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 14px;
}

.shortcuts-tooltip ul {
    list-style: none;
}

.shortcuts-tooltip li {
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.shortcuts-tooltip kbd {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--text-light);
}

.gif-controls {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
}

.gif-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 600;
}

.gif-controls input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.gif-warning {
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    font-size: 12px;
    color: #856404;
    text-align: center;
}

.gif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.miku-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #39c5bb, #5eaee5);
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 99999;
    animation: mikuPulse 1s infinite;
}

.miku-banner h1 {
    color: white;
    font-size: 48px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

@keyframes mikuPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.stats-outside {
    position: fixed;
    top: 70px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 9999;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 18px;
    background: var(--primary);
    border-radius: 12px;
    color: white;
    min-width: 85px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-box i {
    font-size: 22px;
    margin-bottom: 6px;
}

.stat-box span {
    font-size: 20px;
    font-weight: 700;
}

.stat-box small {
    font-size: 11px;
    opacity: 0.9;
    text-transform: lowercase;
}

.main-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
}

.main-container {
    grid-column: 1;
    grid-row: 1 / 3;
    background: var(--bg-white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 60px;
}

.youtube-container {
    grid-column: 2;
    grid-row: 1;
    background: var(--bg-white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 60px;
    min-height: 300px;
}

.changelog-container {
    grid-column: 2;
    grid-row: 2;
    background: var(--bg-white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 400px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.changelog-container h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 18px;
}

.changelog-container iframe {
    flex: 1;
    border: none;
    border-radius: 10px;
    background: var(--bg-light);
}

.youtube-container h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 18px;
}

.youtube-container iframe {
    width: 100%;
    height: 250px;
    border-radius: 10px;
}

.youtube-placeholder {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.youtube-placeholder i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 10px;
}

.youtube-placeholder p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.youtube-placeholder a {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.youtube-placeholder a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

h1 {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    max-width: 100%;
    height: auto;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 15px;
}

.tutorial-dropdown {
    margin-bottom: 30px;
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.tutorial-toggle {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.tutorial-toggle:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.tutorial-arrow {
    transition: transform 0.3s ease;
}

.tutorial-toggle.active .tutorial-arrow {
    transform: rotate(180deg);
}

.tutorial-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: var(--bg-light);
}

.tutorial-content.active {
    max-height: 2000px;
}

.tutorial-section {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.tutorial-section:last-child {
    border-bottom: none;
}

.tutorial-section.alternate {
    background: rgba(255, 243, 205, 0.3);
}

.tutorial-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 18px;
}

.tutorial-section.alternate h3 {
    color: #856404;
}

.tutorial-section ol {
    margin-left: 20px;
    line-height: 1.8;
}

.tutorial-section ol li {
    margin-bottom: 8px;
    color: var(--text-dark);
}

.tutorial-section code {
    background: rgba(80, 80, 80, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary);
}

.tutorial-section a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.tutorial-section a:hover {
    text-decoration: underline;
}

.upload-section {
    margin-bottom: 25px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    border: 3px dashed var(--primary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-light);
    position: relative;
}

.upload-label:hover, .upload-label.dragover {
    border-color: var(--secondary);
    background: rgba(80, 80, 80, 0.05);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
    color: var(--primary);
}

input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.image-preview .preview-item {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    border: 2px solid white;
}

.image-preview .remove-image:hover {
    background: #c92a2a;
}

.image-preview .icon-number {
    width: 100%;
    margin-top: 5px;
    padding: 4px;
    text-align: center;
    border: 2px solid var(--bg-light);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-white);
    color: var(--text-dark);
}

.image-preview .icon-number:focus {
    outline: none;
    border-color: var(--primary);
}

.pack-icon-upload {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pack-icon-upload input[type="file"] {
    display: none;
}

.pack-icon-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid var(--bg-light);
}

.pack-icon-label:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#packIconPreview {
    position: relative;
    display: inline-block;
}

#packIconPreview img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.remove-pack-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    border: 2px solid white;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.remove-pack-icon:hover {
    background: #c92a2a;
}

.ball-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ball-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
}

.ball-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ball-checkbox span {
    user-select: none;
}

.crop-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crop-modal.active {
    display: flex;
    opacity: 1;
}

.crop-modal-content {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.crop-header h3 {
    color: var(--text-dark);
    font-size: 20px;
}

.crop-progress {
    color: var(--text-light);
    font-size: 14px;
}

.crop-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.crop-canvas-wrapper {
    flex: 1;
    text-align: center;
}

#cropCanvas {
    max-width: 100%;
    max-height: 60vh;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
}

.crop-tip {
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

.crop-controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.crop-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.crop-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.crop-btn.primary {
    background: var(--accent);
    color: white;
}

.crop-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.crop-btn.accent {
    background: #28a745;
    color: white;
}

.crop-btn.accent:hover {
    background: #218838;
    transform: translateY(-2px);
}

.crop-btn.secondary {
    background: var(--primary);
    color: white;
}

.crop-btn.secondary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.crop-btn.reset {
    background: #6c757d;
    color: white;
}

.crop-btn.reset:hover {
    background: #5a6268;
}

.crop-btn.undo, .crop-btn.redo {
    background: #17a2b8;
    color: white;
}

.crop-btn.undo:hover:not(:disabled), .crop-btn.redo:hover:not(:disabled) {
    background: #138496;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    color: var(--primary);
    margin-right: 5px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--bg-light);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nf-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result {
    margin-top: 25px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.result.warning {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeeba;
}

.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--bg-light);
    text-align: center;
}

.footer p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 14px;
}

.footer strong {
    color: var(--primary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-links a.donate-link {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.social-links a.donate-link:hover {
    background: linear-gradient(135deg, #ee5a6f, #c92a2a);
}

.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-white);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.92) translateY(16px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity  0.3s ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: auto;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-content {
    padding: 40px;
    position: relative;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--text-dark);
    margin-top: 15px;
    font-size: 24px;
}

.modal-sub {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 6px;
    text-align: center;
}

.modal-body {
    text-align: center;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.modal-close-x {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-x:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.modal-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-btn.donate-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.modal-btn.donate-btn:hover {
    background: linear-gradient(135deg, #ee5a6f, #c92a2a);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

.modal-btn.download-btn,
.modal-btn.copy-btn {
    background: var(--accent);
    color: white;
}

.modal-btn.download-btn:hover,
.modal-btn.copy-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(80, 80, 80, 0.4);
}

.modal-btn.close-btn {
    background: #6c757d;
    color: white;
}

.modal-btn.close-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(108, 117, 125, 0.4);
}

.share-text-box {
    background: var(--bg-light);
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.share-text-box textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    background: transparent;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    resize: vertical;
    outline: none;
}

.donate-modal {
    max-width: 420px;
}

.donate-modal .modal-content {
    padding: 32px 28px 24px;
}

.donate-modal .modal-header i {
    font-size: 40px;
}

.dd-btn-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.dd-link-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-light);
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 13px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.12s, color 0.15s;
}

.dd-link-btn:hover {
    border-color: var(--accent);
    background: rgba(102, 126, 234, 0.08);
    color: var(--accent);
    transform: translateX(4px);
}

.dd-link-btn .dd-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
}

.dd-link-btn .dd-label {
    flex: 1;
    line-height: 1.3;
}

.dd-link-btn .dd-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

.dd-link-btn:hover .dd-sub {
    opacity: 0.75;
}

.dd-link-btn .dd-arrow {
    font-size: 12px;
    opacity: 0.4;
    flex-shrink: 0;
}

.dd-kofi-wrap {
    border-top: 1px solid rgba(128,128,128,0.15);
    padding-top: 16px;
    display: flex;
    justify-content: center;
}

.icon-request-card {
    margin-top: 30px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.icon-request-content h3 {
    color: var(--text-dark);
    margin: 15px 0 10px;
    font-size: 20px;
}

.icon-request-content p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.icon-request-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.icon-request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .main-container {
        grid-column: 1;
        grid-row: 2;
        margin-top: 20px;
    }

    .youtube-container {
        grid-column: 1;
        grid-row: 1;
        margin-top: 80px;
    }

    .changelog-container {
        grid-column: 1;
        grid-row: 3;
        max-height: 400px;
    }

    .stats-outside {
        position: static;
        justify-content: center;
        padding: 20px 0;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 10px;
        gap: 15px;
    }

    .main-container,
    .youtube-container,
    .changelog-container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .crop-container {
        flex-direction: column;
    }

    .pack-icon-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .pack-icon-label {
        width: 100%;
        justify-content: center;
    }

    .ball-options {
        flex-direction: column;
        gap: 10px;
    }

    .image-preview .icon-number {
        font-size: 11px;
        padding: 3px;
    }

    .social-links {
        flex-direction: column;
        align-items: stretch;
    }

    .social-links a {
        justify-content: center;
    }

    .modal-content {
        padding: 25px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .crop-controls {
        gap: 5px;
    }

    .crop-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .shortcuts-help {
        bottom: 80px;
    }

    .donate-modal .modal-content {
        padding: 24px 16px 18px;
    }
}

/* ── FAQ Section ─────────────────────────────────────────────────── */
.faq-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--bg-light);
}

.faq-heading {
    color: var(--text-dark);
    font-size: 26px;
    margin-bottom: 30px;
    font-weight: 700;
}

.faq-category {
    margin-bottom: 35px;
}

.faq-cat-title {
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bg-light);
}

.faq-item {
    border-bottom: 1px solid var(--bg-light);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item summary {
    padding: 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--accent);
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.25s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-item p {
    padding: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 680px;
}

.faq-item p a {
    color: var(--accent);
    text-decoration: none;
}

.faq-item p a:hover {
    text-decoration: underline;
}

.faq-item p code {
    background: rgba(80, 80, 80, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary);
}

@media (prefers-color-scheme: dark) {
    .faq-item p code {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text-dark);
    }
}
