/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E91E63;
    --primary-hover: #C2185B;
    --secondary-color: #9C27B0;
    --background: #FFF5F8;
    --surface: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;

    /* Wrapper gradients */
    --wrapper-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --wrapper-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --wrapper-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

html, body {
    font-family: 'Josefin Slab', serif;
    background: url('../assets/background.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    height: 100%;
    overflow: hidden;
}

/* Allow scroll on non-landing pages */
html:has(body:not(:has(.landing-page))),
body:not(:has(.landing-page)) {
    overflow: auto;
    height: auto;
    min-height: 100vh;
}

/* Image Buttons */
.btn-img {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-img:hover {
    transform: scale(1.05);
}

.btn-img:active {
    transform: scale(0.98);
}

.btn-img img {
    height: 40px;
    width: auto;
    display: block;
}

/* Tab Image Buttons */
.tab-img {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.6;
}

.tab-img:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.tab-img.active {
    opacity: 1;
}

.tab-img img {
    height: 28px;
    width: auto;
    display: block;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: transparent;
    box-shadow: none;
    border: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Minimal header - just button on right */
.header-minimal {
    justify-content: flex-end;
    background: transparent;
    box-shadow: none;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    z-index: 100;
}

.logo {
    display: none;
}

/* Share link in header */
.share-link-header {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-link-header .link-input {
    width: 250px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f5f5f5;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Landing page specific layout */
.landing-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.landing-page .main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow: hidden;
}

/* Palette panel inside canvas area */
.palette-panel {
    margin-top: 8px;
}

.palette-panel .tabs {
    margin-bottom: 4px;
}

.canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-height: 100%;
}

/* Canvas Container */
.canvas-container {
    width: min(calc(100vh - 280px), calc(100vw - 40px)) !important;
    height: min(calc(100vh - 280px), calc(100vw - 40px)) !important;
    min-width: min(400px, calc(100vw - 40px)) !important;
    min-height: min(400px, calc(100vw - 40px)) !important;
    max-width: 1500px;
    max-height: 1500px;
}

.canvas {
    width: 100% !important;
    height: 100% !important;
    background: var(--wrapper-1);
    position: relative;
    overflow: hidden;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    text-align: center;
    pointer-events: none;
    padding: 20px;
}

/* Action Icons (undo/shuffle/redo) */
.action-icons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: #f0f0f0;
}

.icon-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Palette Container */
.palette-container {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    max-width: 100%;
    overflow: hidden;
    width: min(600px, calc(100vw - 40px));
}


/* Placed Flowers on Canvas */
.placed-flower {
    position: absolute;
    cursor: move;
    transition: box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flower-img {
    height: 200px;
    width: auto;
    pointer-events: none;
    display: block;
}

.placed-flower:hover {
    filter: brightness(1.1);
}

.placed-flower.selected {
    outline: 3px solid white;
    outline-offset: 2px;
}

.placed-flower .delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    width: 24px;
    height: 24px;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.placed-flower.selected .delete-btn {
    display: flex;
}

/* Transform button (rotation/resize) - bottom left */
.placed-flower .transform-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translate(-50%, 50%);
    width: 24px;
    height: 24px;
    background: #4D96FF;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    cursor: grab;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.placed-flower .transform-btn:active {
    cursor: grabbing;
}

.placed-flower.selected .transform-btn {
    display: flex;
}

/* Drag ghost for touch drag preview */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
    transform: translate(-50%, -50%);
}

.drag-ghost img {
    height: 100px;
    width: auto;
}

/* Prevent scroll when dragging */
body.is-dragging {
    overflow: hidden;
    touch-action: none;
}

body.is-dragging * {
    touch-action: none;
}

/* Bottom Panel */
.bottom-panel {
    background: var(--surface);
    padding: 16px 24px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Landing page tabs */
.landing-page .tabs {
    margin-bottom: 8px;
}

.landing-page .tab {
    background: var(--border-color);
    color: var(--text-primary);
    padding: 6px 16px;
    font-size: 1rem;
}

.landing-page .tab.active {
    background: var(--border-color);
    color: var(--text-primary);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tab.active {
    background: var(--primary-color);
    color: white;
}

.tab:hover:not(.active) {
    background: #f0f0f0;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Palette */
.palette {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.palette::-webkit-scrollbar {
    height: 6px;
}

.palette::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.palette::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.palette::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.palette.hidden {
    display: none;
}

.palette-item {
    width: 80px;
    min-width: 80px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.palette-item:hover {
    transform: scale(1.05);
}

.palette-item.flower {
    border-radius: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.palette-item.flower img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.palette-item.wrapper {
    width: 80px;
    height: 100px;
    border: 1px solid var(--border-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.palette-item.wrapper.selected {
    border: 3px solid var(--primary-color);
}

/* ===== LAYERED BOUQUET (Preview/View Pages) ===== */
.bouquet-layer {
    position: absolute;
    pointer-events: none;
}

.bouquet-back {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    height: 80%;
    width: auto;
    z-index: 1;
    object-fit: contain;
}

.bouquet-flowers {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
    transform-origin: center 40%;
}

/* Scale the entire flower cluster on smaller screens */
@media (max-width: 768px) {
    .bouquet-flowers {
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .bouquet-flowers {
        transform: scale(0.5);
    }
}

@media (max-width: 320px) {
    .bouquet-flowers {
        transform: scale(0.4);
    }
}

.bouquet-flowers .placed-flower {
    pointer-events: none;
    position: absolute;
}

.bouquet-flower .flower-img {
    height: 200px;
    width: auto;
}

.bouquet-front {
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    height: 58%;
    width: auto;
    z-index: 3;
    object-fit: contain;
}

/* ===== LETTER PAGE ===== */
.letter-content {
    flex: 1;
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: calc(100vh - 60px);
}

.letter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.preview-section,
.letter-section {
    background: var(--surface);
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.preview-section.no-border,
.letter-section.no-border {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.preview-section {
    width: 350px;
    flex-shrink: 1;
    max-height: 45vh;
}

.letter-section {
    width: 350px;
    flex-shrink: 1;
}

.preview-section h3,
.letter-section h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
}

.preview-canvas {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 40vh;
    position: relative;
    overflow: visible !important;
}

.preview-section {
    overflow: visible !important;
}

/* Letter envelope with image background */
.letter-envelope-container {
    position: relative;
    width: 100%;
}

.letter-bg {
    width: 100%;
    height: auto;
    display: block;
}

.letter-envelope-container .letter-textarea {
    position: absolute !important;
    top: 20% !important;
    left: 15% !important;
    width: 60% !important;
    height: 24% !important;
    min-height: unset !important;
    background: transparent !important;
    border: none !important;
    resize: none !important;
    font-family: 'Cedarville Cursive', cursive;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    padding: 8px;
}

.letter-envelope-container .letter-textarea:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.letter-envelope-container .letter-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Letter preview text (for preview page) */
.letter-preview-text {
    position: absolute !important;
    top: 20% !important;
    left: 15% !important;
    width: 60% !important;
    height: 24% !important;
    font-family: 'Cedarville Cursive', cursive;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    padding: 8px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.letter-textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
}

.letter-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.char-count {
    margin-top: 8px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== PREVIEW PAGE ===== */
.preview-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.preview-title {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-weight: 400;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.letter-preview-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-paper {
    background: #FFFEF0;
    padding: 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    width: 100%;
    min-height: 300px;
    border: 1px solid #E8E8D8;
}

.letter-paper .letter-content {
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-primary);
}

/* ===== SHARE PAGE ===== */
.share-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-shrink: 0;
}

/* Center content vertically on share page */
.letter-content:has(.share-actions) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.letter-content:has(.share-actions) .letter-container {
    min-height: auto;
    height: auto;
    flex-shrink: 1;
}

.share-actions .btn-img img {
    height: 40px;
}

.share-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 350px;
}

.share-link-row .link-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--surface);
}

.share-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.share-container {
    text-align: center;
    max-width: 500px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.share-container h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.share-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.link-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--surface);
}

.copy-feedback {
    color: #4CAF50;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.copy-feedback.hidden {
    display: none;
}

.share-note {
    background: #FFF3E0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.share-note p {
    color: #E65100;
    font-size: 0.9rem;
}

.sent-preview h3 {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.mini-preview {
    display: flex;
    justify-content: center;
}

.mini-canvas {
    width: 150px;
    height: 200px;
}

/* ===== VIEW PAGE (RECEIVER) ===== */

/* Envelope Page (First page) */
.envelope-view {
    min-height: 100vh;
}

.envelope-view.hidden {
    display: none;
}

.envelope-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    min-height: 100vh;
}

.gift-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 32px;
    text-align: center;
}

.closed-envelope-container {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.closed-envelope-container:hover {
    transform: scale(1.05);
}

.closed-envelope {
    max-width: 350px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.open-hint {
    color: var(--text-secondary);
    margin-top: 24px;
    font-size: 1rem;
    text-align: center;
}

/* Revealed View (Second page) */
.revealed-view {
    min-height: 100vh;
}

.revealed-view.hidden {
    display: none;
}

.revealed-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.revealed-section {
    display: flex;
    justify-content: center;
}

.revealed-letter-section {
    display: flex;
    align-items: center;
}

.revealed-letter {
    animation: fadeIn 0.5s ease;
}

/* Error View */
.error-view {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--background);
}

.error-view.hidden {
    display: none;
}

.error-container {
    text-align: center;
    padding: 24px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.error-container h2 {
    margin-bottom: 8px;
}

.error-container p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}


/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .logo {
        font-size: 1rem;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .letter-container,
    .preview-container,
    .revealed-container {
        flex-direction: column;
        gap: 8px;
        justify-content: flex-start;
        align-items: center;
    }

    .preview-section,
    .letter-section {
        width: 100% !important;
        max-width: 350px;
        max-height: 42vh;
    }

    .preview-canvas {
        max-height: 38vh;
    }

    .letter-envelope-container {
        max-height: 38vh;
    }

    .letter-bg {
        max-height: 38vh;
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .canvas-container {
        width: min(calc(100vh - 320px), calc(100vw - 40px)) !important;
        height: min(calc(100vh - 320px), calc(100vw - 40px)) !important;
        min-width: 250px !important;
        min-height: 250px !important;
        max-width: 450px !important;
        max-height: 450px !important;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .palette-item {
        width: 55px;
        height: 70px;
    }

    .palette-item.wrapper {
        width: 55px;
        height: 70px;
    }

    .flower-img {
        height: 120px;
    }

    .palette-container {
        padding: 10px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
    }

    .logo {
        font-size: 0.9rem;
    }

    .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .main-content {
        padding: 8px;
    }

    .bottom-panel {
        padding: 10px 12px;
    }

    .canvas-area {
        gap: 12px;
    }

    .canvas-container {
        width: min(calc(100vh - 300px), calc(100vw - 20px)) !important;
        height: min(calc(100vh - 300px), calc(100vw - 20px)) !important;
        min-width: 200px !important;
        min-height: 200px !important;
        max-width: 350px !important;
        max-height: 350px !important;
    }

    .palette-container {
        width: calc(100vw - 16px);
        padding: 8px;
    }

    .palette-panel {
        margin-top: 4px;
    }

    .tabs {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
    }

    .letter-content {
        padding: 5px;
        height: calc(100vh - 50px);
    }

    .letter-container {
        flex-direction: column;
        padding: 0;
        gap: 5px;
        justify-content: flex-start;
        align-items: center;
    }

    .preview-section,
    .letter-section {
        width: 100% !important;
        max-width: 100%;
        max-height: 38vh;
    }

    .preview-canvas {
        max-height: 34vh;
    }

    .letter-envelope-container {
        max-height: 32vh;
    }

    .letter-bg {
        max-height: 32vh;
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .letter-section h3 {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }

    /* Share page - vertical layout matching letter page */
    .letter-content:has(.share-actions) .letter-container {
        flex-direction: column !important;
    }

    .letter-content:has(.share-actions) .preview-section,
    .letter-content:has(.share-actions) .letter-section {
        width: 100% !important;
        max-width: 100%;
        max-height: 38vh;
    }

    .letter-content:has(.share-actions) .preview-canvas {
        max-height: 34vh;
    }

    .letter-content:has(.share-actions) .letter-envelope-container,
    .letter-content:has(.share-actions) .letter-bg {
        max-height: 32vh;
    }

    .share-actions {
        gap: 5px;
        margin-top: 5px;
    }

    .share-actions .btn-img img {
        height: 28px;
    }

    .share-link-row {
        max-width: 280px;
    }

    .share-link-row .link-input {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .action-buttons .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .palette {
        justify-content: flex-start;
    }

    .palette-item {
        width: 45px;
        min-width: 45px;
        height: 60px;
    }

    .palette-item.wrapper {
        width: 45px;
        min-width: 45px;
        height: 60px;
    }

    .flower-img {
        height: 90px;
    }

    .placed-flower .delete-btn,
    .placed-flower .transform-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .action-icons {
        gap: 8px;
    }

    .gift-title {
        font-size: 1.4rem;
    }

    .envelope {
        width: 160px;
        height: 120px;
    }

    .letter-content,
    .preview-content,
    .revealed-content {
        padding: 16px;
    }

    .letter-textarea {
        min-height: 200px;
    }

    /* Smaller font for mobile letter */
    .letter-envelope-container .letter-textarea,
    .letter-preview-text {
        font-size: 0.65rem;
    }

}

/* Very small screens */
@media (max-width: 320px) {
    .palette-item {
        width: 40px;
        height: 60px;
    }
}
