/* ============================================================
   HOONEYPHRASE STUDIO — Premium Design System
   ============================================================ */

:root {
    --hp-bg: #070709;
    --hp-card: #0d0d10;
    --hp-accent: #10b981;
    --hp-accent-hover: #059669;
    --hp-accent-glow: rgba(16,185,129,0.18);
    --hp-blue: #3b82f6;
    --hp-blue-glow: rgba(59,130,246,0.18);
    --hp-border: #1e1e24;
    --hp-text: #f1f5f9;
    --hp-surface: #0b0b0e;
    --hp-surface-2: #111116;
    --hp-surface-3: #1c1c22;
    --hp-surface-4: #26262e;
    --hp-muted: #71717a;
    --hp-muted-2: #52525b;
    --hp-radius: 14px;
    --hp-radius-sm: 8px;
    --hp-sidebar-w: 66px;
    --hp-panel-w: 310px;
    --hp-topbar-h: 54px;
}

/* ── Base ── */
.hooney-app-container {
    position: relative;
    font-family: 'Lexend', system-ui, sans-serif;
    background: var(--hp-surface);
    overflow: hidden;
    width: 100%;
    height: 860px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px var(--hp-border);
    border-radius: 16px;
}
.hooney-app-container * { box-sizing: border-box; }

/* Fullscreen */
.hooney-app-container.hp-fullscreen-mode {
    position: fixed !important; inset: 0 !important;
    width: 100vw !important; height: 100vh !important;
    max-width: none !important; margin: 0 !important;
    border-radius: 0 !important; z-index: 2147483647 !important;
    border: none !important; transform: none !important;
}

/* ============================================================
   WELCOME SCREEN
   ============================================================ */
.hp-welcome-screen {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 20% 10%, #0d1f13 0%, #07070a 60%),
                radial-gradient(ellipse at 80% 90%, #0b1526 0%, transparent 60%);
    z-index: 999;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.hp-welcome-bg-effects { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hp-welcome-orb {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
    animation: hpOrbFloat 9s ease-in-out infinite;
}
.hp-orb-1 { width: 380px; height: 380px; background: #10b981; top: -80px; right: -80px; animation-delay: 0s; }
.hp-orb-2 { width: 280px; height: 280px; background: #3b82f6; bottom: -60px; left: -60px; animation-delay: 2.5s; }
.hp-orb-3 { width: 220px; height: 220px; background: #8b5cf6; top: 50%; left: 40%; animation-delay: 5s; opacity: 0.18; }

@keyframes hpOrbFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(18px,-22px) scale(1.06); }
    66% { transform: translate(-14px,16px) scale(0.94); }
}

.hp-welcome-content {
    position: relative; z-index: 2; text-align: center;
    max-width: 620px; width: 92%;
    animation: hpWelcomeFadeUp .9s cubic-bezier(.16,1,.3,1);
}
@keyframes hpWelcomeFadeUp {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hp-welcome-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(59,130,246,.15));
    border: 1px solid rgba(16,185,129,.3);
    color: #6ee7b7; font-size: 11px; font-weight: 700;
    padding: 6px 18px; border-radius: 100px;
    letter-spacing: 2px; margin-bottom: 22px; text-transform: uppercase;
}
.hp-welcome-title {
    color: #fff; font-size: 42px; font-weight: 800;
    margin: 0 0 12px; line-height: 1.15; letter-spacing: -.5px;
}
.hp-welcome-title span {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hp-welcome-subtitle {
    color: var(--hp-muted); font-size: 16px; margin: 0 0 42px; font-weight: 300;
}

/* Format Cards */
.hp-format-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp-format-card {
    background: rgba(17,17,22,.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--hp-border);
    border-radius: 20px; padding: 30px 22px;
    cursor: pointer; position: relative;
    transition: all .4s cubic-bezier(.16,1,.3,1); overflow: hidden;
}
.hp-format-card::before {
    content: ''; position: absolute; inset: 0; border-radius: 20px;
    background: linear-gradient(135deg, rgba(16,185,129,.08) 0%, transparent 60%);
    opacity: 0; transition: opacity .4s;
}
.hp-format-card:hover { border-color: var(--hp-accent); transform: translateY(-8px); box-shadow: 0 24px 48px rgba(16,185,129,.12); }
.hp-format-card:hover::before { opacity: 1; }
.hp-format-card:hover h3 { color: var(--hp-accent); }

.hp-format-preview { display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.hp-format-horiz svg { width: 100%; max-width: 160px; height: auto; }
.hp-format-vert { min-height: 110px; }
.hp-format-vert svg { width: 60px; height: auto; }
.hp-format-info h3 { color: #fff; font-size: 17px; font-weight: 700; margin: 0 0 4px; transition: color .3s; }
.hp-format-info .hp-format-size { color: var(--hp-muted-2); font-size: 12px; }
.hp-format-tag {
    position: absolute; top: 14px; right: 14px;
    background: rgba(16,185,129,.12); color: var(--hp-accent);
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    padding: 4px 10px; border-radius: 20px; letter-spacing: .5px; border: 1px solid rgba(16,185,129,.2);
}
.hp-format-tag.hp-tag-story { background: rgba(59,130,246,.12); color: var(--hp-blue); border-color: rgba(59,130,246,.2); }

/* Templates */
.hp-templates-section { margin-top: 32px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.06); }
.hp-templates-label { color: var(--hp-muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; margin: 0 0 14px; font-weight: 600; }
.hp-templates-grid { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hp-template-card { cursor: pointer; text-align: center; transition: all .3s; width: 86px; }
.hp-template-card:hover { transform: translateY(-5px); }
.hp-template-card:hover .hp-template-preview { box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.hp-template-preview {
    width: 86px; height: 58px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.08); margin-bottom: 6px;
    transition: box-shadow .3s;
}
.hp-template-card span { color: var(--hp-muted-2); font-size: 10px; font-weight: 500; }

.hp-randomize-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; max-width: 300px; margin: 20px auto 0;
    padding: 13px 20px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(16,185,129,.1), rgba(59,130,246,.1));
    border: 1px solid rgba(16,185,129,.25);
    color: #d1fae5; font-size: 14px; font-weight: 600;
    font-family: 'Lexend', sans-serif; cursor: pointer; transition: all .3s;
}
.hp-randomize-btn:hover { background: linear-gradient(135deg, rgba(16,185,129,.2), rgba(59,130,246,.2)); border-color: var(--hp-accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,.2); }
.hp-randomize-btn svg { fill: currentColor; transition: transform .6s cubic-bezier(.34,1.56,.64,1); }
.hp-randomize-btn.hp-spin-active svg { transform: rotate(360deg); }

/* ============================================================
   EDITOR LAYOUT
   ============================================================ */
.hp-interface-wrapper { width: 100%; height: 100%; display: flex; overflow: hidden; }

/* ── Sidebar ── */
.hp-sidebar-icons {
    width: var(--hp-sidebar-w); background: var(--hp-surface-2);
    border-right: 1px solid var(--hp-border);
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 0; gap: 2px; z-index: 20; flex-shrink: 0;
    transition: all .35s cubic-bezier(.16,1,.3,1);
}
.hp-sidebar-icons.hp-floating-icons {
    position: absolute; left: auto; right: 0; top: var(--hp-topbar-h);
    width: 58px; height: calc(100% - var(--hp-topbar-h));
    border-left: 1px solid var(--hp-border); border-right: none;
    padding: 8px 0; gap: 1px;
}

.hp-icon-tab {
    width: 52px; height: 54px; border-radius: var(--hp-radius-sm);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--hp-muted); font-size: 8.5px; font-weight: 600;
    cursor: pointer; transition: all .2s; border: none;
    background: transparent; gap: 4px; letter-spacing: .3px;
    position: relative;
}
.hp-icon-tab:hover { background: rgba(255,255,255,.04); color: #e2e8f0; }
.hp-icon-tab.active {
    background: linear-gradient(135deg, rgba(16,185,129,.14), rgba(16,185,129,.05));
    color: var(--hp-accent); font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(16,185,129,.2),
                inset 3px 0 0 var(--hp-accent);
    border-radius: 0 var(--hp-radius-sm) var(--hp-radius-sm) 0;
}
.hp-icon-tab svg { width: 20px; height: 20px; fill: currentColor; }
.hp-icon-tab.active svg { filter: drop-shadow(0 0 6px rgba(16,185,129,.5)); }

/* ── Controls Panel ── */
.hooney-controls {
    width: var(--hp-panel-w);
    background: var(--hp-surface);
    border-right: 1px solid var(--hp-border);
    display: flex; flex-direction: column;
    overflow-y: auto; z-index: 10; flex-shrink: 0;
    transition: all .35s cubic-bezier(.16,1,.3,1);
}
.hooney-controls.hp-floating-mode {
    position: absolute; right: 0; top: var(--hp-topbar-h);
    width: 330px; height: calc(100% - var(--hp-topbar-h));
    border-left: 1px solid var(--hp-border); border-right: none;
    box-shadow: -16px 0 40px rgba(0,0,0,.4); z-index: 25;
}
.hooney-controls.hp-floating-mode { max-height: 100%; overflow-y: auto; overflow-x: hidden; }
.hooney-controls::-webkit-scrollbar,
.hooney-controls.hp-floating-mode::-webkit-scrollbar { width: 4px; }
.hooney-controls::-webkit-scrollbar-track,
.hooney-controls.hp-floating-mode::-webkit-scrollbar-track { background: transparent; }
.hooney-controls::-webkit-scrollbar-thumb,
.hooney-controls.hp-floating-mode::-webkit-scrollbar-thumb { background: var(--hp-surface-4); border-radius: 4px; }
.hooney-controls::-webkit-scrollbar-thumb:hover,
.hooney-controls.hp-floating-mode::-webkit-scrollbar-thumb:hover { background: var(--hp-muted-2); }

.hooney-panes { padding: 14px; }
.hooney-pane { display: none; }
.hooney-pane.active { display: block; animation: hpPaneIn .25s ease; }
@keyframes hpPaneIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hp-pane-title {
    font-size: 13px; font-weight: 700; color: #e2e8f0;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--hp-border);
    display: flex; align-items: center; gap: 8px;
}

/* ── Workspace ── */
.hooney-workspace-wrapper {
    flex: 1; display: flex; flex-direction: column;
    background: #050507; position: relative; overflow: hidden;
}

/* ── Top Bar ── */
.hooney-top-bar {
    height: var(--hp-topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px;
    background: var(--hp-surface-2);
    border-bottom: 1px solid var(--hp-border);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}
.hp-header-left { display: flex; align-items: center; gap: 10px; }
.hp-header-actions { display: flex; gap: 6px; align-items: center; }

.hp-back-home {
    display: flex; align-items: center; gap: 6px;
    color: var(--hp-muted); text-decoration: none;
    font-size: 12px; font-weight: 600;
    padding: 6px 11px; border-radius: var(--hp-radius-sm);
    transition: all .2s; border: 1px solid transparent;
}
.hp-back-home:hover { background: var(--hp-surface-4); color: #e2e8f0; border-color: var(--hp-border); }
.hp-back-home svg { width: 15px; height: 15px; fill: currentColor; }

/* Panel Toggle */
.hp-panel-toggle-btn {
    background: transparent; border: 1px solid var(--hp-surface-3);
    color: var(--hp-muted); width: 32px; height: 32px;
    border-radius: var(--hp-radius-sm); cursor: pointer;
    display: none; align-items: center; justify-content: center; transition: all .2s;
}
.hp-panel-toggle-btn:hover { background: var(--hp-surface-3); color: #fff; border-color: var(--hp-accent); }
.hp-panel-toggle-btn.active { background: var(--hp-accent-glow); border-color: var(--hp-accent); color: var(--hp-accent); }
.hp-panel-toggle-btn svg { width: 16px; height: 16px; fill: currentColor; }
.hooney-app-container.hp-floating-layout .hp-panel-toggle-btn { display: flex; }

/* History Buttons */
.hp-history-btn, #hp-fullscreen-toggle {
    background: transparent; border: 1px solid var(--hp-surface-3);
    color: var(--hp-muted); width: 32px; height: 32px;
    border-radius: var(--hp-radius-sm); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.hp-history-btn svg, #hp-fullscreen-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.hp-history-btn:hover, #hp-fullscreen-toggle:hover { background: var(--hp-surface-3); color: #fff; }
.hp-history-btn:disabled { opacity: .3; cursor: not-allowed; }

.hp-divider-vert { width: 1px; height: 20px; background: var(--hp-surface-3); margin: 0 3px; }

/* Action Buttons */
.hooney-btn-download {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #fff !important; border: none !important;
    padding: 8px 16px; border-radius: 10px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 5px;
    font-size: 12px; transition: all .2s;
    font-family: 'Lexend', sans-serif;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
    letter-spacing: .2px;
}
.hooney-btn-download:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.4); }

.hooney-btn-export {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important; border: none !important;
    padding: 8px 20px; border-radius: 10px; font-weight: 800;
    cursor: pointer; font-size: 12px; letter-spacing: .4px;
    display: flex; align-items: center; gap: 5px; transition: all .2s;
    font-family: 'Lexend', sans-serif;
    box-shadow: 0 4px 14px rgba(16,185,129,.35);
    text-transform: uppercase;
}
.hooney-btn-export:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,.45); }

.hp-zoom-label { color: var(--hp-muted-2); font-size: 11px; font-weight: 600; min-width: 34px; text-align: center; user-select: none; }

/* ── Canvas Area ── */
.hooney-canvas-area {
    flex: 1; display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 0; width: 100%; height: 100%;
    position: relative; touch-action: none !important;
    background-color: #050507;
    background-image:
        radial-gradient(ellipse at 15% 85%, rgba(16,185,129,.045) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 15%, rgba(59,130,246,.04) 0%, transparent 50%),
        linear-gradient(45deg, rgba(255,255,255,.008) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.008) 25%, transparent 25%);
    background-size: 100% 100%, 100% 100%, 20px 20px, 20px 20px;
}

/* Alignment Guides */
.hp-alignment-guide { position: absolute; z-index: 999; pointer-events: none; background: rgba(16,185,129,.5); }
.hp-guide-horizontal { width: 100%; height: 1px; left: 0; top: 50%; }
.hp-guide-vertical   { height: 100%; width: 1px; top: 0; left: 50%; }

/* ── Viewport ── */
#hooney-viewport {
    background: #000;
    box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
    position: relative; overflow: hidden; flex-shrink: 0;
    transform-origin: center center; opacity: 1 !important; touch-action: none;
}
#hooney-viewport::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: radial-gradient(circle at center, rgba(0,0,0,0) 20%, rgba(0,0,0,.4) 140%);
}
#hooney-viewport::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='3' width='1' height='1' fill='rgba(0,0,0,0.1)'/%3E%3Crect x='1' y='2' width='1' height='1' fill='rgba(0,0,0,0.1)'/%3E%3Crect x='2' y='1' width='1' height='1' fill='rgba(0,0,0,0.1)'/%3E%3Crect x='3' y='0' width='1' height='1' fill='rgba(0,0,0,0.1)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}
#hooney-bg-layer, #hooney-overlay-layer, #hooney-frame-layer {
    position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#hooney-bg-layer { object-fit: cover; z-index: 0; filter: brightness(.95) contrast(1.08); }
#hooney-overlay-layer { background: #000; opacity: 0; z-index: 1; }
#hooney-frame-layer { z-index: 10; background-size: 100% 100%; }

#hooney-text-wrapper, #hooney-text-extra {
    position: absolute; top: 0; left: 0; transform: none !important;
    z-index: 100; cursor: grab; text-align: center; color: #fff;
    width: max-content; min-width: 50px; max-width: 90%;
    white-space: pre-wrap; user-select: none;
    text-shadow: 0 4px 16px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.4);
}
#hooney-text-wrapper:hover, #hooney-text-extra:hover {
    border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.02);
}
#hooney-text-extra { font-size: 30px; display: none; line-height: 1.1; }
#hooney-text-main { line-height: inherit; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; pointer-events: none; }

/* Highlights & Emoji */
.hp-highlight-word { transition: color .2s; }
.hp-emoji { display: inline-block; line-height: 1; }

/* ── Stickers ── */
.hp-canvas-sticker {
    position: absolute; z-index: 50; cursor: grab; color: #fff;
    width: 60px; height: 60px; top: 50%; left: 50%;
    transition: opacity .2s; touch-action: none;
    border: 1px dashed transparent;
    display: flex; align-items: center; justify-content: center; text-align: center;
}
.hp-canvas-sticker:hover, .hp-canvas-sticker:active { border-color: rgba(255,255,255,.5); }
.hp-canvas-sticker svg { width: 100%; height: 100%; fill: currentColor; }
.hp-sticker-delete {
    position: absolute; top: -12px; right: -12px;
    width: 26px; height: 26px; background: #ef4444; color: #fff;
    border-radius: 50%; display: none; align-items: center; justify-content: center;
    font-size: 18px; font-weight: bold; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.4); z-index: 999; line-height: 1;
}
.hp-canvas-sticker:hover .hp-sticker-delete,
.hp-canvas-sticker:active .hp-sticker-delete,
.hp-canvas-sticker.is-active .hp-sticker-delete { display: flex; }
.hp-canvas-sticker .hp-emoji { font-size: 1em !important; line-height: 1; display: block; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.hp-input-field textarea {
    width: 100%; height: 82px;
    background: var(--hp-surface-2); color: var(--hp-text);
    border: 1px solid var(--hp-border);
    padding: 12px; border-radius: var(--hp-radius-sm);
    resize: none; font-family: inherit; font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.hp-input-field textarea:focus { border-color: var(--hp-accent); outline: none; box-shadow: 0 0 0 3px var(--hp-accent-glow); }

.hp-control-group { margin-bottom: 14px; }
.hp-control-label {
    display: block; font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--hp-muted-2); margin-bottom: 8px; font-weight: 700;
}

/* Color */
.hp-color-grid { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hp-color-swatch {
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: all .2s; flex-shrink: 0;
}
.hp-color-swatch:hover { transform: scale(1.18); filter: brightness(1.1); }
.hp-color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2.5px var(--hp-accent), 0 0 14px var(--hp-accent-glow); }
.hp-color-picker-input { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px dashed var(--hp-surface-4); background: transparent; padding: 0; -webkit-appearance: none; appearance: none; overflow: hidden; flex-shrink: 0; }
.hp-color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
.hp-color-picker-input::-webkit-color-swatch { border: none; border-radius: 50%; }

/* Sliders */
.hp-slider-row { margin-bottom: 10px; }
.hp-slider-header { display: flex; justify-content: space-between; color: var(--hp-muted); font-size: 11px; margin-bottom: 6px; }
input[type=range] {
    width: 100%; accent-color: var(--hp-accent); cursor: pointer;
    height: 4px; background: var(--hp-surface-4); border-radius: 2px;
    -webkit-appearance: none; appearance: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--hp-accent); cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4);
    transition: transform .15s;
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.15); }

/* Text Fields */
.hp-text-field {
    width: 100%; background: var(--hp-surface-2); color: #fff;
    border: 1px solid var(--hp-border);
    padding: 8px 10px; border-radius: var(--hp-radius-sm);
    font-family: 'Lexend', sans-serif; font-size: 13px; margin-bottom: 8px;
    transition: border-color .2s;
}
.hp-text-field:focus { border-color: var(--hp-accent); outline: none; box-shadow: 0 0 0 3px var(--hp-accent-glow); }

/* Toggle Buttons */
.hp-tool-toggle-btn {
    width: 100%; background: var(--hp-surface-2); border: 1px solid var(--hp-border);
    color: var(--hp-muted); padding: 10px 14px; border-radius: 10px;
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    transition: all .2s; font-family: 'Lexend', sans-serif; text-align: left;
}
.hp-tool-toggle-btn:hover { background: rgba(16,185,129,.05); border-color: rgba(16,185,129,.25); color: #e2e8f0; }
.hp-tool-toggle-btn.active { background: rgba(16,185,129,.1); border-color: var(--hp-accent); color: var(--hp-accent); }
.hp-small-btn { padding: 8px 12px; font-size: 12px; }

/* Sub Controls */
.hp-sub-controls {
    margin-top: 8px; padding: 12px;
    background: var(--hp-surface-2); border-radius: 10px;
    border: 1px solid var(--hp-border); animation: hpSubIn .25s ease;
}
@keyframes hpSubIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Align Buttons */
.hp-align-btn {
    flex: 1; background: transparent; border: none; color: var(--hp-muted);
    padding: 8px; border-radius: 6px; cursor: pointer; font-size: 12px;
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.hp-align-btn.active { background: var(--hp-surface-4); color: #fff; }
.hp-align-btn:hover:not(.active) { background: rgba(255,255,255,.03); color: #e2e8f0; }

/* Shadow Type Selector */
.hp-shadow-types { display: flex; gap: 5px; flex-wrap: wrap; }
.hp-shadow-type-btn {
    flex: 1; min-width: 50px; max-width: 68px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 4px; background: var(--hp-surface-2);
    border: 1px solid var(--hp-border); border-radius: 10px;
    cursor: pointer; transition: all .2s; color: var(--hp-muted);
    font-family: 'Lexend', sans-serif;
}
.hp-shadow-type-btn:hover { border-color: rgba(255,255,255,.15); }
.hp-shadow-type-btn.active { border-color: var(--hp-accent); background: rgba(16,185,129,.08); color: var(--hp-accent); }
.hp-shadow-type-preview { font-size: 18px; font-weight: 700; color: #e2e8f0; line-height: 1; }
.hp-shadow-type-btn span:last-child { font-size: 9px; font-weight: 600; letter-spacing: .3px; }

/* Position Grid */
.hp-position-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.hp-pos-btn {
    background: var(--hp-surface-2); border: 1px solid var(--hp-border);
    color: var(--hp-muted); padding: 9px 6px; border-radius: var(--hp-radius-sm);
    cursor: pointer; font-size: 10.5px; font-weight: 600;
    font-family: 'Lexend', sans-serif;
    display: flex; align-items: center; gap: 4px; transition: all .2s;
}
.hp-pos-btn:hover { background: rgba(16,185,129,.07); border-color: rgba(16,185,129,.25); color: #e2e8f0; }
.hp-pos-btn:active { background: rgba(16,185,129,.14); color: var(--hp-accent); }

/* Upload Button */
.hp-upload-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 10px 14px; border-radius: 10px;
    background: var(--hp-surface-2); border: 1.5px dashed var(--hp-surface-4);
    color: var(--hp-muted); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s; font-family: 'Lexend', sans-serif;
}
.hp-upload-btn:hover { background: rgba(16,185,129,.05); border-color: rgba(16,185,129,.3); color: var(--hp-accent); }

/* ============================================================
   GALLERY — Background Bank
   ============================================================ */
.hp-assets-container { display: none; }
.hp-show-horiz { display: block !important; }

/* Spinner Ring */
.hp-spinner-ring {
    width: 36px; height: 36px; border-radius: 50%; margin: 0 auto;
    border: 3px solid var(--hp-surface-3);
    border-top-color: var(--hp-accent);
    animation: hpSpin .8s linear infinite;
}
@keyframes hpSpin { to { transform: rotate(360deg); } }

.hp-bg-explorer-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    padding-bottom: 16px;
}
.hp-bg-thumb {
    aspect-ratio: 1/1; border-radius: 10px; cursor: pointer;
    border: 2px solid var(--hp-border); overflow: hidden;
    transition: all .22s; display: flex; align-items: center;
    justify-content: center; background: var(--hp-surface-2);
    position: relative;
}
.hp-bg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-bg-thumb::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(16,185,129,.0); transition: background .2s;
}
.hp-bg-thumb:hover { border-color: var(--hp-accent); transform: scale(1.04); }
.hp-bg-thumb:hover::after { background: rgba(16,185,129,.08); }
.hp-bg-thumb.active { border-color: var(--hp-accent); box-shadow: 0 0 0 3px var(--hp-accent-glow), 0 6px 20px rgba(16,185,129,.2); }
.hp-container-vertical .hp-bg-thumb { aspect-ratio: 9/16; }

/* Stickers Grid */
.hp-stickers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hp-sticker-item {
    background: var(--hp-surface-2); color: #fff;
    border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .22s;
}
.hp-sticker-item:hover { background: var(--hp-surface-4); color: var(--hp-accent); transform: scale(1.08); }

/* ============================================================
   CONTEXT TOOLBAR (Canva-style)
   ============================================================ */
.hp-context-toolbar {
    display: flex; align-items: center; gap: 3px;
    padding: 4px 10px;
    background: var(--hp-surface-2);
    border-bottom: 1px solid var(--hp-border);
    flex-shrink: 0; overflow: visible; white-space: nowrap;
    z-index: 50; position: relative; height: 40px;
}
.hp-ctx-divider { width: 1px; height: 18px; background: var(--hp-surface-4); flex-shrink: 0; }

.hp-ctx-font-select {
    background: var(--hp-surface-3); color: #fff;
    border: 1px solid var(--hp-surface-4);
    padding: 4px 20px 4px 8px; border-radius: 6px;
    font-family: 'Lexend', sans-serif; font-size: 12px; cursor: pointer;
    width: 120px; flex-shrink: 0; height: 30px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2394a3b8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 3px center; background-size: 13px;
    transition: border-color .2s;
}
.hp-ctx-font-select:focus { border-color: var(--hp-accent); outline: none; }

.hp-ctx-size-group {
    display: flex; align-items: center; gap: 1px;
    background: var(--hp-surface-3); border: 1px solid var(--hp-surface-4);
    border-radius: 6px; padding: 1px; height: 30px;
}
.hp-ctx-size-value { color: #fff; font-size: 12px; font-weight: 700; min-width: 24px; text-align: center; user-select: none; }

.hp-ctx-btn {
    background: transparent; border: none; color: var(--hp-muted);
    width: 28px; height: 28px; border-radius: 5px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-family: 'Lexend', sans-serif;
    transition: all .15s; flex-shrink: 0; padding: 0;
}
.hp-ctx-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.hp-ctx-btn.active, .hp-ctx-style.active { background: rgba(16,185,129,.14); color: var(--hp-accent); }

.hp-ctx-color-wrapper { position: relative; }
.hp-ctx-color-btn {
    background: transparent; border: 1px solid var(--hp-surface-4);
    color: #fff; width: 30px; height: 30px; border-radius: 6px;
    cursor: pointer; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px; transition: border-color .2s;
}
.hp-ctx-color-btn:hover { border-color: var(--hp-accent); }
.hp-ctx-color-bar { display: block; width: 18px; height: 3px; border-radius: 2px; transition: background .2s; }
.hp-ctx-color-popup {
    display: none; position: absolute; top: calc(100% + 6px); left: 50%;
    transform: translateX(-50%); background: var(--hp-surface-2);
    border: 1px solid var(--hp-surface-4); border-radius: 12px;
    padding: 12px; z-index: 9999; box-shadow: 0 16px 48px rgba(0,0,0,.7);
    min-width: 200px; animation: hpPopupIn .2s ease;
}
.hp-ctx-color-popup.open { display: block; }
@keyframes hpPopupIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.hp-ctx-color-popup .hp-color-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 6px; }
.hp-ctx-align-group {
    display: flex; align-items: center; gap: 1px;
    background: var(--hp-surface-3); border: 1px solid var(--hp-surface-4);
    border-radius: 6px; padding: 1px; height: 30px;
}
.hp-ctx-align-group .hp-align-btn { width: 28px; height: 26px; border-radius: 5px; }
.hp-ctx-align-group .hp-align-btn svg { width: 13px; height: 13px; }

/* Custom Font Picker */
.hp-custom-font-picker { position: relative; width: 100%; }
.hp-font-selected-display {
    background: var(--hp-surface-2); border: 1px solid var(--hp-border);
    padding: 10px 12px; border-radius: 10px; color: #fff;
    cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; user-select: none; font-size: 14px; transition: border-color .2s;
}
.hp-font-selected-display:hover { border-color: var(--hp-accent); }
.hp-font-selected-display::after { content: '▼'; font-size: 8px; color: var(--hp-muted-2); }
.hp-font-dropdown-list {
    position: absolute; top: 105%; left: 0; width: 100%;
    max-height: 250px; overflow-y: auto;
    background: var(--hp-surface-2); border: 1px solid var(--hp-surface-4);
    border-radius: 10px; z-index: 999; display: none;
    box-shadow: 0 16px 40px rgba(0,0,0,.6);
}
.hp-font-dropdown-list.open { display: block; }
.hp-font-dropdown-list::-webkit-scrollbar { width: 4px; }
.hp-font-dropdown-list::-webkit-scrollbar-thumb { background: var(--hp-surface-4); border-radius: 4px; }
.hp-font-option-item {
    padding: 10px 12px; cursor: pointer; color: #cbd5e1;
    border-bottom: 1px solid rgba(255,255,255,.03); font-size: 15px;
    display: flex; align-items: center; justify-content: space-between; transition: background .15s;
}
.hp-font-option-item:hover { background: var(--hp-surface-4); color: #fff; }
.hp-font-option-item.selected { background: var(--hp-accent-glow); color: var(--hp-accent); }

.hp-context-toolbar .hp-custom-font-picker { width: 130px; min-width: 100px; max-width: 130px; flex-shrink: 0; }
.hp-context-toolbar .hp-font-selected-display { padding: 4px 10px; font-size: 12px; border-radius: 6px; height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-context-toolbar .hp-font-selected-display::after { font-size: 7px; margin-left: 4px; flex-shrink: 0; }
.hp-context-toolbar .hp-font-dropdown-list { z-index: 9999; width: 220px; min-width: 220px; position: fixed; top: auto; left: auto; }
.hp-context-toolbar .hp-font-option-item { padding: 7px 10px; font-size: 13px; }

/* ============================================================
   MODALS
   ============================================================ */
.hp-login-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.9);
    z-index: 999999; display: none; align-items: center;
    justify-content: center; backdrop-filter: blur(8px);
}
.hp-login-card {
    background: var(--hp-surface-2); padding: 44px;
    border-radius: 22px; text-align: center;
    max-width: 400px; width: 90%;
    border: 1px solid var(--hp-border);
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
}
.hp-login-card h3 { color: #fff; font-size: 22px; margin-bottom: 12px; }
.hp-login-card p { color: var(--hp-muted); font-size: 14px; line-height: 1.6; margin-bottom: 26px; }
.hp-login-btn {
    display: inline-block; background: linear-gradient(135deg, #10b981, #059669);
    color: #fff; padding: 13px 32px; border-radius: 12px;
    font-weight: 800; text-decoration: none; font-size: 14px; transition: all .2s;
    box-shadow: 0 6px 20px rgba(16,185,129,.35);
}
.hp-login-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.hp-login-close {
    display: block; margin-top: 18px; background: none; border: none;
    color: var(--hp-muted); cursor: pointer; font-size: 13px; font-family: 'Lexend', sans-serif;
}
#hooney-success-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9);
    z-index: 999999999 !important; align-items: center; justify-content: center;
}

/* ============================================================
   UI RESIZE HANDLES
   ============================================================ */
.ui-resizable-handle { position: absolute; font-size: .1px; display: block; touch-action: none; z-index: 110; }
.ui-resizable-e, .ui-resizable-w { cursor: ew-resize; width: 14px; top: 0; height: 100%; background: transparent; transition: background .2s; }
.ui-resizable-e:hover, .ui-resizable-w:hover { background: rgba(16,185,129,.15); }
.ui-resizable-e { right: -7px; }
.ui-resizable-w { left: -7px; }

/* ============================================================
   WORDPRESS OVERRIDES
   ============================================================ */
#secondary, #sidebar, .widget-area, .sidebar-main { display: none !important; }
.content-layout, .site-content, .content-area, .site-main { width: 100% !important; max-width: 100% !important; display: block !important; flex: none !important; }
.content-main { width: 100% !important; max-width: 100% !important; margin: 0 auto !important; padding: 0 !important; }
.container { width: 100% !important; max-width: 100% !important; padding: 0 !important; }

/* ============================================================
   MOBILE (≤900px) — App-First Layout
   ============================================================ */
@media (max-width: 900px) {
    body { overflow: hidden; }
    .hooney-app-container {
        position: fixed !important; inset: 0 !important;
        width: 100vw !important; height: 100dvh !important;
        margin: 0 !important; border-radius: 0 !important;
        border: none !important; z-index: 9999999 !important;
        background: #000;
    }
    .hp-interface-wrapper { display: flex !important; flex-direction: column !important; width: 100% !important; height: 100% !important; overflow: hidden !important; }
    .hooney-workspace-wrapper { flex: 1 !important; height: auto !important; order: 1; overflow: hidden; display: flex; flex-direction: column; }
    .hooney-canvas-area { flex: 1 !important; padding: 0 !important; width: 100% !important; height: 100% !important; display: flex !important; align-items: center !important; justify-content: center !important; background-color: #000; overflow: hidden !important; }
    #hooney-viewport { box-shadow: none !important; }
    .hooney-controls { width: 100% !important; height: auto !important; max-height: 44%; order: 2; border-right: none !important; border-top: 1px solid var(--hp-border); flex-shrink: 1 !important; background: var(--hp-surface); position: relative !important; right: auto !important; top: auto !important; }
    .hooney-controls.hp-floating-mode { position: relative !important; width: 100% !important; height: auto !important; top: auto !important; border-left: none !important; border-top: 1px solid var(--hp-border); box-shadow: none !important; }
    .hp-sidebar-icons { width: 100% !important; height: 54px !important; flex-direction: row !important; justify-content: space-around !important; padding: 0 !important; border-right: none !important; border-top: 1px solid var(--hp-border); order: 3; flex-shrink: 0 !important; background: var(--hp-surface-2); position: relative; z-index: 50; }
    .hp-sidebar-icons.hp-floating-icons { position: relative !important; width: 100% !important; height: auto !important; top: auto !important; right: auto !important; border-radius: 0 !important; flex-direction: row !important; border-left: none !important; border-top: 1px solid var(--hp-border); border-bottom: none !important; box-shadow: none !important; padding: 0 !important; }
    .hp-icon-tab { width: auto; height: auto; padding: 8px 12px; border-radius: 0; box-shadow: none !important; }
    .hp-icon-tab.active { box-shadow: inset 0 -3px 0 var(--hp-accent) !important; background: rgba(16,185,129,.06) !important; }
    #hp-fullscreen-toggle, .hp-panel-toggle-btn { display: none !important; }
    .hp-back-home span { display: none !important; }
    .hp-back-home { padding: 8px !important; }
    .hooney-top-bar { height: 46px !important; padding: 0 10px !important; }
    .hp-welcome-title { font-size: 28px; }
    .hp-welcome-subtitle { font-size: 14px; margin-bottom: 26px; }
    .hp-format-cards { gap: 12px; }
    .hp-format-card { padding: 20px 14px; border-radius: 16px; }
    .hp-btn-label { display: none; }
    .hooney-btn-download { padding: 7px 10px !important; }
    .hooney-btn-export { padding: 7px 12px !important; font-size: 11px; }
    .hp-context-toolbar { padding: 3px 6px; gap: 2px; height: 36px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .hp-context-toolbar::-webkit-scrollbar { display: none; }
    .hp-ctx-font-select { width: 80px; min-width: 70px; font-size: 11px; padding: 3px 16px 3px 5px; height: 28px; }
    .hp-ctx-btn { width: 26px; height: 26px; font-size: 12px; }
    .hp-ctx-size-group, .hp-ctx-align-group { height: 28px; }
    .hp-ctx-size-value { font-size: 11px; min-width: 20px; }
    .hp-ctx-color-btn { width: 28px; height: 28px; }
    .hp-ctx-color-popup { left: 0; transform: none; min-width: 180px; }
    @keyframes hpPopupIn {
        from { opacity: 0; transform: translateY(-5px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .hp-context-toolbar .hp-custom-font-picker { width: 90px; min-width: 80px; max-width: 100px; }
    .hp-context-toolbar .hp-font-selected-display { padding: 3px 6px; font-size: 11px; height: 28px; }
}

/* ============================================================
   FLOATING LAYOUT (901px–1279px)
   ============================================================ */
@media (min-width: 901px) and (max-width: 1279px) {
    .hp-interface-wrapper { position: relative; }
    .hp-sidebar-icons { position: fixed; right: 0; top: 0; height: 100%; width: 58px; border-left: 1px solid var(--hp-border); border-right: none; z-index: 30; padding: 8px 0; flex-shrink: 1; }
    .hooney-controls { position: fixed; right: 0; top: var(--hp-topbar-h); height: calc(100% - var(--hp-topbar-h)); width: 0; opacity: 0; visibility: hidden; transition: all .35s cubic-bezier(.16,1,.3,1); z-index: 29; }
    .hooney-controls.hp-panel-visible { width: 330px; opacity: 1; visibility: visible; border-left: 1px solid var(--hp-border); box-shadow: -20px 0 50px rgba(0,0,0,.5); }
    .hooney-workspace-wrapper { margin-right: 58px; }
    .hp-panel-toggle-btn { display: flex !important; margin-right: 8px; }
    .hp-icon-tab { padding: 10px 6px; width: 46px; height: auto; gap: 2px; font-size: 8px; }
    .hp-icon-tab span { display: none; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes hpSlideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes hpFadeScaleIn {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes hpPulse { 0%,100% { opacity: 1; } 50% { opacity: .65; } }
@keyframes hpGlowPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.6); } 50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } }

.hp-icon-tab.active svg { animation: hpFadeScaleIn .3s cubic-bezier(.16,1,.3,1); }
.hooney-controls.hp-panel-visible { animation: hpSlideInRight .35s cubic-bezier(.16,1,.3,1); }
#hp-panel-toggle:active { animation: hpGlowPulse .5s; }