* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
}

/* Improve touch interactions */
button, .sticker, .library-item, .color-btn, .center-color-btn, .border-color-option, .border-style-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.vinyl-preview {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    margin-top: 80px;
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(15px);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 200;
}

.back-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.save-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(15px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 200;
}

.save-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.title {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    margin-top: 30px;
}

.custom-wrapper {
    display: block;
    width: 100%;
    padding-bottom: 150px;
    padding-top: 0;
}

/* Preview Section - Full Width */
.preview-section {
    background: transparent;
    padding: 10px 30px 30px;
    text-align: center;
    position: relative;
}

/* Bottom Toolbar */
.bottom-toolbar {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    z-index: 100;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bottom-toolbar::before,
.bottom-toolbar::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 1;
}

.bottom-toolbar::before {
    left: 0;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.3), transparent);
}

.bottom-toolbar::after {
    right: 0;
    background: linear-gradient(to left, rgba(102, 126, 234, 0.3), transparent);
}

.bottom-toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-item {
    position: relative;
}

.toolbar-item {
    position: relative;
    flex-shrink: 0;
    scroll-snap-align: center;
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(15px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    z-index: 2;
}

.toolbar-btn span {
    font-size: 1.5rem;
}

.toolbar-btn small {
    font-size: 0.7rem;
    font-weight: 600;
}

.toolbar-btn:hover {
    transform: translateY(-5px);
    background: rgba(102, 126, 234, 0.5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.toolbar-panel {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 -4px 20px rgba(118, 75, 162, 0.3);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    margin-bottom: 10px;
}

.toolbar-item:hover .toolbar-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.toolbar-item.active .toolbar-panel {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
    pointer-events: all !important;
}

/* Disable hover on touch devices */
@media (hover: none) {
    .toolbar-item:hover .toolbar-panel {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.toolbar-panel label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 8px 0 6px 0;
    color: #333;
}

.stickers-panel {
    min-width: 300px;
    max-height: 300px;
    overflow-y: auto;
}

.sticker-library-mini {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.sticker-category-mini {
    display: contents;
}

.preview-section h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.drag-hint {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-style: italic;
}

.vinyl-preview {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    border-radius: 50%;
    position: relative;
    margin: 0 auto 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.vinyl-preview.vinyl-black { background: radial-gradient(circle, #1a1a1a 0%, #000 100%); }
.vinyl-preview.vinyl-blue { background: radial-gradient(circle, #1e3a8a 0%, #0c1844 100%); }
.vinyl-preview.vinyl-red { background: radial-gradient(circle, #7f1d1d 0%, #450a0a 100%); }
.vinyl-preview.vinyl-purple { background: radial-gradient(circle, #581c87 0%, #3b0764 100%); }
.vinyl-preview.vinyl-green { background: radial-gradient(circle, #14532d 0%, #052e16 100%); }
.vinyl-preview.vinyl-gold { 
    background: radial-gradient(circle, #fbbf24 0%, #d97706 100%);
}

.vinyl-preview.spinning {
    animation: spin 3s linear infinite;
}

.grooves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 3px,
        rgba(255,255,255,0.03) 3px,
        rgba(255,255,255,0.03) 4px
    );
    pointer-events: none;
}

.vinyl-center-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255,107,107,0.5);
    z-index: 1;
    pointer-events: none;
}

.vinyl-preview.spinning .vinyl-center-preview {
    animation: counterSpin 3s linear infinite;
}

.center-color {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.center-color.center-red { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.center-color.center-blue { background: linear-gradient(135deg, #667eea, #764ba2); }
.center-color.center-pink { background: linear-gradient(135deg, #f093fb, #f5576c); }
.center-color.center-green { background: linear-gradient(135deg, #13f287, #0dcb7d); }
.center-color.center-orange { background: linear-gradient(135deg, #ff9a56, #ff6a00); }

/* Instagram-style Sticker Container */
#stickersContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Instagram-style Sticker */
.sticker-preview {
    position: absolute;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 2;
    transform: translate(-50%, -50%);
    border: 3px solid white;
    cursor: move;
    pointer-events: auto;
    transition: box-shadow 0.2s ease;
    user-select: none;
    touch-action: none;
}

.sticker-preview.no-border {
    border: none;
}

.sticker-preview.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 0 6px 20px rgba(0,0,0,0.4);
}

.sticker-preview.text-sticker {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    min-width: 60px;
    width: auto;
    white-space: nowrap;
}

.sticker-preview.image-sticker {
    background: transparent;
    border: 3px solid white;
    padding: 0;
    border-radius: 15px;
}

.sticker-preview.image-sticker.no-border {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sticker-preview.image-sticker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
    border-radius: 12px;
}

.sticker-emoji-preview {
    font-size: 2rem;
    pointer-events: none;
}

.sticker-text-preview {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    pointer-events: none;
}

/* Sticker Controls (Instagram-style) */
.sticker-controls {
    position: absolute;
    top: -10px;
    right: -10px;
    display: none;
    gap: 5px;
    pointer-events: auto;
    z-index: 10;
}

.sticker-preview.selected .sticker-controls {
    display: flex;
}

.sticker-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sticker-control-btn:hover {
    transform: scale(1.15);
    background: #764ba2;
}

.sticker-control-btn.delete-btn {
    background: #ff6b6b;
    font-weight: bold;
}

.sticker-control-btn.delete-btn:hover {
    background: #ee5a6f;
}

/* Border Editor Panel */
.border-editor {
    position: fixed;
    top: auto;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(118, 75, 162, 0.3);
    z-index: 150;
    display: none;
    min-width: 280px;
    max-width: 320px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: none;
}

.border-editor::-webkit-scrollbar {
    display: none;
}

.border-editor.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.border-editor-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1rem;
}

.border-option {
    margin-bottom: 12px;
}

.border-option label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.border-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #667eea;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: left 0.3s;
}

.toggle-switch.active::after {
    left: 27px;
}

.border-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.border-color-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.border-color-option:hover {
    transform: scale(1.1);
}

.border-color-option.active {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.border-width-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.border-width-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.border-width-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.border-width-value {
    font-weight: bold;
    color: #667eea;
}

.border-style-options {
    display: flex;
    gap: 8px;
}

.border-style-btn {
    flex: 1;
    padding: 8px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.border-style-btn:hover {
    background: #e0e0e0;
}

.border-style-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.border-editor-close {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    font-weight: bold;
}

.border-editor-close:hover {
    background: #ee5a6f;
}

.vinyl-preview.spinning .sticker-preview {
    animation: counterSpin 3s linear infinite;
}

/* Preview Controls */
.preview-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-spin, .btn-add-sticker {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-add-sticker {
    background: linear-gradient(135deg, #13f287, #0dcb7d);
}

.btn-spin:hover, .btn-add-sticker:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Form Section */
.form-section {
    background: rgba(255,255,255,0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.form-section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-align: center;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 10px 15px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
    animation: fadeInTab 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.form-hint {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-btn, .center-color-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover, .center-color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active, .center-color-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Pen color buttons */
.pen-color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pen-color-btn:hover {
    transform: scale(1.1);
}

.pen-color-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.btn-clear-draw {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-draw:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Drawing canvas */
#drawingCanvas {
    border-radius: 50%;
}

/* Sticker Library (Instagram-style) */
.sticker-library-wrapper {
    position: relative;
}

.library-toggle {
    display: none;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.library-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.library-toggle.collapsed::after {
    content: ' ▼';
}

.library-toggle.expanded::after {
    content: ' ▲';
}

.sticker-library {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: #fafafa;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.sticker-library.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    border: none;
}

.sticker-category {
    margin-bottom: 20px;
}

.category-title {
    display: block;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.library-stickers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
}

.library-item {
    font-size: 2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.library-item:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.library-item:active {
    transform: scale(1.05);
}

/* Text Sticker Input */
.text-sticker-input {
    display: flex;
    gap: 10px;
}

#textInput {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border 0.3s ease;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
}

.btn-text-add {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-text-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Image Upload */
.image-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-image-upload {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-image-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.upload-filename {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    min-height: 20px;
}

.btn-save {
    width: 100%;
    background: linear-gradient(135deg, #13f287, #0dcb7d);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-top: 10px;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.save-note {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes counterSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Responsive */
@media (max-width: 968px) {
    body {
        padding: 10px 8px 100px 8px;
    }
    
    .custom-wrapper {
        padding-bottom: 120px;
    }
    
    .preview-section {
        padding: 15px;
    }
    
    .vinyl-preview {
        width: 340px;
        height: 340px;
    }
    
    .vinyl-center-preview {
        width: 105px;
        height: 105px;
    }
    
    .drag-hint {
        font-size: 0.85rem;
        padding: 8px 15px;
        margin-bottom: 15px;
    }
    
    .bottom-toolbar {
        bottom: 15px;
        gap: 8px;
        padding: 0 10px;
    }
    
    .toolbar-btn {
        min-width: 65px;
        padding: 10px 14px;
    }
    
    .toolbar-btn span {
        font-size: 1.3rem;
    }
    
    .toolbar-panel {
        min-width: 260px;
        max-width: 90vw;
        padding: 18px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px 5px 110px 5px;
    }
    
    .custom-wrapper {
        padding-bottom: 120px;
    }
    
    .back-btn,
    .save-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        top: 8px;
    }
    
    .back-btn {
        left: 8px;
    }
    
    .save-btn {
        right: 8px;
    }
    
    .title {
        font-size: 1.2rem;
        margin-top: 50px;
    }
    
    .vinyl-preview {
        width: 260px;
        height: 260px;
    }
    
    .vinyl-center-preview {
        width: 80px;
        height: 80px;
    }
    
    .preview-section {
        padding: 12px 8px;
    }
    
    .drag-hint {
        font-size: 0.75rem;
        padding: 6px 12px;
        margin-bottom: 12px;
    }
    
    .bottom-toolbar {
        bottom: 8px;
        gap: 6px;
        padding: 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        justify-content: flex-start;
    }
    
    .bottom-toolbar::before,
    .bottom-toolbar::after {
        width: 15px;
    }
    
    .toolbar-btn {
        min-width: 62px;
        padding: 9px 12px;
    }
    
    .toolbar-btn span {
        font-size: 1.3rem;
    }
    
    .toolbar-btn small {
        font-size: 0.65rem;
    }
    
    .toolbar-panel {
        min-width: 270px;
        max-width: 90vw;
        padding: 15px;
        bottom: 80px;
    }
    
    .stickers-panel {
        min-width: 280px;
    }
    
    .sticker-library-mini {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .library-item {
        font-size: 1.4rem;
        padding: 8px;
    }
    
    .color-btn, .center-color-btn, .text-color-btn {
        width: 38px;
        height: 38px;
    }
    
    .pen-color-btn {
        width: 36px;
        height: 36px;
    }
    
    input[type="range"] {
        height: 32px;
    }
    
    .border-editor {
        bottom: 80px;
        max-width: 88vw;
        max-height: 240px;
        padding: 15px;
    }
    
    .btn-text-add, .btn-image-upload, .btn-clear-draw, .btn-eraser {
        padding: 10px;
        font-size: 0.85rem;
        touch-action: manipulation;
    }
}

/* Media query for very small screens */
@media (max-width: 360px) {
    body {
        padding: 5px 5px 100px 5px;
    }
    
    .custom-wrapper {
        padding-bottom: 110px;
    }
    
    .title {
        font-size: 1.1rem;
        margin-top: 45px;
    }
    
    .vinyl-preview {
        width: 220px;
        height: 220px;
    }
    
    .vinyl-center-preview {
        width: 65px;
        height: 65px;
    }
    
    .preview-section {
        padding: 10px 5px;
    }
    
    .drag-hint {
        font-size: 0.7rem;
        padding: 5px 10px;
        margin-bottom: 10px;
    }
    
    .bottom-toolbar {
        bottom: 6px;
        gap: 5px;
        padding: 0 6px;
    }
    
    .toolbar-btn {
        min-width: 58px;
        padding: 8px 10px;
    }
    
    .toolbar-btn span {
        font-size: 1.2rem;
    }
    
    .toolbar-btn small {
        font-size: 0.6rem;
    }
    
    .toolbar-panel {
        min-width: 250px;
        max-width: 92vw;
        padding: 12px;
        bottom: 70px;
    }
    
    .stickers-panel {
        min-width: 260px;
    }
    
    .sticker-library-mini {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .library-item {
        font-size: 1.3rem;
        padding: 6px;
    }
    
    .color-btn, .center-color-btn {
        width: 34px;
        height: 34px;
    }
    
    .pen-color-btn {
        width: 32px;
        height: 32px;
    }
    
    input[type="range"] {
        height: 30px;
    }
    
    .border-editor {
        bottom: 70px;
        max-width: 90vw;
        padding: 12px;
    }
}