@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* =========================================================
   DESIGN DIRECTION — "Loadout HUD"
   A battle-royale tactical interface: near-black olive UI,
   amber flare + night-vision lime accents, condensed
   military type, targeting-reticle corner brackets on every
   font card, and an angled "weapon select" active state on
   the category bar. All original class/id names preserved —
   only tokens, type system and a few decorative pseudo-
   elements changed. Rebuilt mobile-first and performance
   conscious throughout.
   ========================================================= */

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

:root {
    --bg-primary: #fdf6ea;
    --bg-surface: #fffdf8;
    --bg-surface-2: #f8ead0;
    --bg-surface-3: #f0dbaf;
    --accent: #e2720f;
    --stamp-gold: #6d7f2c;
    --nickname: #e2720f;
    --ink: #fffaf0;
    --text-primary: #2a2115;
    --text-secondary: #59503d;
    --text-muted: #8c8368;
    --text-light: #d9c89f;
    --border: rgba(42, 33, 21, 0.13);
    --shadow-soft: 0 4px 18px rgba(42, 33, 21, 0.09);
    --radius-sm: 3px;
    --radius: 6px;
    --radius-xl: 999px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t: 0.15s;
    --font: 'Inter', -apple-system, system-ui, sans-serif;
    --font-display: 'Rajdhani', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Space Mono', monospace
}

/* Night-ops variant: near-black tactical HUD, same family of accents */
html.dark {
    --bg-primary: #050806;
    --bg-surface: #0b100c;
    --bg-surface-2: #121810;
    --bg-surface-3: #1a2216;
    --accent: #ff8c3d;
    --stamp-gold: #d4ff5c;
    --ink: #050806;
    --text-primary: #f2f5ee;
    --text-secondary: #9fae9f;
    --text-muted: #5b6b5c;
    --text-light: #2a332a;
    --border: rgba(242, 245, 238, 0.1);
    --shadow-soft: 0 4px 22px rgba(0, 0, 0, 0.6)
}

html.dark body {
    background-image:
        radial-gradient(ellipse 55% 35% at 10% 0%, rgba(255, 122, 26, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 45% 30% at 95% 100%, rgba(200, 255, 61, 0.04) 0%, transparent 50%)
}

html.dark .menu-wrapper::after {
    background: linear-gradient(to right, transparent, var(--bg-surface))
}

html.dark .input-sec {
    background: linear-gradient(to bottom, #050806 75%, transparent)
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth
}

body {
    background: var(--bg-primary);
    font-family: var(--font);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    padding: 0;
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom);
    /* faint HUD scan-grid instead of paper grain */
    background-image:
        radial-gradient(ellipse 55% 35% at 10% 0%, rgba(226, 114, 15, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 45% 30% at 95% 100%, rgba(109, 127, 44, 0.05) 0%, transparent 50%),
        linear-gradient(rgba(42, 33, 21, 0.02) 1px, transparent 1px);
    background-size: auto, auto, 100% 3px
}

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

.deco-dialog {
    background: var(--bg-primary)
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    text-transform: uppercase;
}

h1 {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0.01em;
    margin-bottom: 0.2rem;
}

h1 span {
    color: var(--accent);
    font-weight: 700;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 1.6rem 0 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

/* signature: h2 eyebrow reads like a HUD status LED, not a decorative rule */
h2::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    background: var(--stamp-gold);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    flex-shrink: 0
}

h3 {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-display);
    margin: 1rem 0 0.4rem
}

p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.75;
    font-size: 0.95rem
}

ul,
ol {
    padding-left: 1.4rem;
    margin: 0.3rem 0 0.65rem
}

li {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem
}

/* header card */
header {
    background: var(--bg-surface-2);
    padding: calc(10px + env(safe-area-inset-top)) 0 10px;
    border-bottom: 1.5px solid var(--border);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* brand */
.brand-link {
    display: flex;
    align-items: center;
    gap: 5px;
}

.brand-link a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-link img {
    height: 45px;
    width: 45px;
    border-radius: 5px;
}

.brand-link span {
    color: var(--accent);
    font-family: var(--font-mono);
    text-transform: none;
    font-weight: 500;
    font-size: 0.8rem;
}

/* desktop nav */
.nav-desktop {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

.nav-desktop a {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-desktop a:hover,
.nav-desktop a.active {
    color: var(--accent);
}

/* more button in desktop */
.more-wrapper {
    position: relative;
}

.more-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.more-btn:hover {
    color: var(--accent);
}

.more-btn svg {
    width: 1rem;
    height: 1rem;
    stroke: var(--text-light);
    transition: transform 0.2s ease;
}

.more-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    min-width: 160px;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 20;
    border: 1.5px solid var(--border);
}

.dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.dropdown a:hover {
    background: var(--bg-surface-2);
    color: var(--accent);
}

/* right side: hamburger only (no translate) */
.right-actions {
    display: none;
}

.hamburger {
    display: flex;
    padding: 0.55rem;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger:hover {
    background: var(--bg-surface-2);
}

.hamburger svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--text-light);
    stroke-width: 2;
    fill: none;
}

/* ----- mobile menu (hidden by default) ----- */
.mobile-menu {
    display: none;
    background: var(--bg-surface);
    padding: 1rem 1.5rem;
    margin-top: 10px;
}

.mobile-menu.open {
    display: block;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-height: 24rem;
    overflow-y: auto;
}

.mobile-nav a {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.35rem 0;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--accent);
}

.mobile-footer {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px dashed var(--border);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--text-muted);
}

.page-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 2px 10px;
}

.page-info p {
    max-width: 44rem;
    color: var(--text-muted);
    margin-top: 10px;
    margin-bottom: 0;
}

.btn-group {
    text-align: right;
}

.input-sec {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 0.5rem;
    background: linear-gradient(to bottom, var(--bg-primary) 75%, transparent)
}

/* signature: the input reads like a tactical console field — top scanline,
   flare-orange border, ink-well accent replaced with HUD ring */
.input {
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--accent);
    padding: 0.4rem;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    margin: 0 1% 5px 1%;
    overflow: hidden
}

.input::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    pointer-events: none;
}

.input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.16);
}

.input textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    /* prevents iOS auto-zoom on focus */
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    padding: 0.4rem 2.4rem 0.3rem 0.2rem;
    min-height: 44px;
    line-height: 1.5;
    text-align: center;
}

.input textarea::placeholder {
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

#inputCount {
    position: absolute;
    bottom: 0.2rem;
    right: 60px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    padding: 0.05rem 0.5rem;
    border-radius: var(--radius-sm);
    pointer-events: none;
    font-weight: 700
}

#clearInput,
#bioIdeas {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: all var(--t) var(--ease);
    -webkit-tap-highlight-color: transparent
}

#clearInput:hover {
    background: #b23a2e;
    color: white
}

#bioIdeas {
    right: 0;
    top: auto;
    width: auto;
    padding: 5px 12px;
    height: 28px;
    bottom: 0;
    background: var(--stamp-gold);
    color: var(--ink);
    border: none;
    cursor: pointer;
    display: block;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm) 0;
}

#bioIdeas:hover {
    filter: brightness(1.08)
}

#clearInput:active,
#bioIdeas:active {
    transform: scale(0.9)
}

.share-it {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.share-it span {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
    font-family: var(--font-mono);
}

#st-1 {
    z-index: 9 !important;
}

.share-url {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.share-url label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-mono);
}

.share-url input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--bg-surface-2);
    border-radius: 5px 0 0 5px;
    font-size: 16px;
    height: 42px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    outline: none;
    font-family: var(--font-mono);
}

.share-url button {
    padding: 5px 14px;
    background: var(--bg-surface-2);
    color: var(--text-muted);
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    font-size: 13px;
    height: 42px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background 0.2s;
    white-space: nowrap;
    font-family: var(--font-mono);
}

.share-url button:hover {
    background: var(--accent);
    color: var(--ink);
}

/* category / weapon-select bar */
.menu-wrapper {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    position: relative;
    width: 100%;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 0.18rem 0.12rem;
    margin-bottom: 5px;
    border: 1.5px solid var(--border);
    overflow: hidden
}

#topMenu {
    display: flex;
    gap: 0.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.15rem 0.1rem 0.2rem;
    flex: 1;
    align-items: center;
    scroll-behavior: smooth
}

#topMenu::-webkit-scrollbar {
    display: none
}

.nav-btn,
.btn-group button {
    flex-shrink: 0;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.9rem;
    font-size: clamp(0.68rem, 1.3vw, 0.78rem);
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
    transition: all var(--t) var(--ease);
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    -webkit-tap-highlight-color: transparent;
    user-select: none
}

.nav-btn i {
    font-style: normal;
    font-weight: 700
}

.nav-btn:hover,
.btn-group button:hover {
    color: var(--text-primary);
    background: var(--bg-surface-2)
}

.nav-btn:active,
.btn-group button:active {
    transform: scale(0.94)
}

/* active = "equipped" — angled cut, flare-orange fill */
.nav-btn.active,
.deco-mood-chip.active {
    color: var(--ink);
    background: var(--accent);
    font-weight: 700;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.scroll-btn {
    background: var(--bg-surface-2);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    touch-action: manipulation;
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--t) var(--ease);
    -webkit-tap-highlight-color: transparent;
    user-select: none
}

.scroll-btn:hover {
    background: var(--accent);
    color: var(--ink);
    border-color: var(--accent)
}

.scroll-btn:active {
    transform: scale(0.9)
}

.scroll-btn:disabled {
    opacity: 0.2;
    pointer-events: none
}

.cat-name h2 {
    font-size: clamp(0.65rem, 1.6vw, 0.75rem);
    margin: 0;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted)
}

.cat-name h2::before {
    width: 6px;
    height: 6px;
}

.cat-name span {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--stamp-gold);
    padding: 0.06rem 0.6rem;
    font-weight: 700;
    margin-left: 6px;
}

/* Names List Container */
.nameslist {
    margin-top: 10px;
}

/* List styling - INLINE */
.nameslist ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
}

/* Each list item — stamped as an ammo/loadout tag */
.nameslist li {
    display: inline-flex;
    align-items: center;
    padding: 2px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    gap: 2px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    min-height: 40px;
    flex-shrink: 0;
    flex-direction: column;
}

.nameslist li:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.nameslist li:active {
    transform: scale(0.95);
    background: var(--bg-surface-2);
}

.nameslist li p {
    margin: 0;
    pointer-events: none;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: inherit;
}

.nameslist li span {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    user-select: none;
}

/* Copy notification toast — reads like a kill-feed line */
.toast {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 10px 26px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--accent);
    border-left: 4px solid var(--accent);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transition: all 0.35s var(--ease);
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* signature: font cards get targeting-reticle corner brackets that
   snap brighter on hover/focus, like a locked-on HUD target box */
.font,
.qList p {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    position: relative;
    margin-bottom: 10px;
    margin-top: 6px;
    overflow: visible;
    content-visibility: auto;
    contain-intrinsic-size: auto 64px;
}

.font::before,
.font::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-light);
    transition: border-color var(--t) var(--ease);
    pointer-events: none;
}

.font::before {
    top: -6px;
    left: -6px;
    border-right: none;
    border-bottom: none;
}

.font::after {
    bottom: -6px;
    right: -6px;
    border-left: none;
    border-top: none;
}

.font:hover,
.font:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-soft);
}

.font:hover::before,
.font:hover::after,
.font:focus-within::before,
.font:focus-within::after {
    border-color: var(--accent);
}

.font:hover span {
    display: block
}

.font p {
    font-size: 1.25rem;
    margin: 0;
    word-break: break-word;
    line-height: 1.5;
    color: var(--text-secondary);
    flex: 1;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: color var(--t) var(--ease)
}

.font p:hover {
    color: var(--accent)
}

.dark .font p:hover,
.dark .font .alert:hover {
    color: #fff
}

.font div {
    width: 100%;
    position: relative;
}

.font span {
    position: absolute;
    bottom: 0;
    right: 0;
    pointer-events: none;
    user-select: none;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    padding: 0.04rem 0.5rem;
    margin-left: 3px;
}

.alert {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    color: var(--accent);
}

/* the copy button reads as a HUD action key */
.font button,
.otools a {
    background: var(--bg-surface-2);
    border-left: 1.5px solid var(--border);
    padding: 0.3rem 0.9rem;
    font-size: clamp(0.62rem, 1.2vw, 0.72rem);
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    cursor: pointer;
    touch-action: manipulation;
    height: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t) var(--ease);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.font button:hover,
.otools a:hover {
    background: var(--stamp-gold);
    color: var(--ink);
}

.font button:active,
.otools a:active {
    transform: scale(0.94)
}

.deco-cards-container {
    overflow: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.deco-loadmore-wrap {
    margin: 5px 5px 10px 5px;
    display: flex;
    justify-content: center;
}

.deco-loadmore-btn {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.8rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink);
    cursor: pointer;
    touch-action: manipulation;
    transition: all var(--t) var(--ease);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 44px;
}

.deco-loadmore-btn:active {
    transform: scale(0.96);
}

.load-more-trigger {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block
}

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

.random-card-grid {
    display: block
}

#decoDialogClose {
    color: var(--text-secondary)
}

.cat-name {
    margin: 10px;
}

.regen {
    position: fixed;
    bottom: calc(20% + env(safe-area-inset-bottom));
    right: 0;
    display: flex;
    gap: 6px;
    flex-direction: column;
    align-items: flex-end;
    z-index: 99;
}

.regen svg {
    width: 20px;
    height: 20px;
}

.regen button {
    padding: 12px 14px;
    border-radius: 50% 0 0 50%;
    cursor: pointer;
    border: 1.5px solid var(--border);
    border-right: none;
    background: var(--bg-surface);
    font-size: 1rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-soft);
    transition: all var(--t) var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    min-height: 44px;
}

.regen button:hover {
    background: var(--accent);
    color: var(--ink);
    border-color: transparent
}

#regen {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    padding: 10px;
    border-radius: 50% 0 0 50%;
    align-items: center;
}

.info-text {
    padding: 0 12px
}

.info-text img {
    max-width: 720px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-soft)
}

#bottomMenu {
    margin-top: 15px;
}

footer {
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1.5px solid var(--border);
}

footer .container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

footer .container p {
    color: var(--text-muted);
}

.menu-wrapper {
    position: relative;
    overflow: hidden
}

.menu-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 18px;
    pointer-events: none;
    background: linear-gradient(to right, transparent, var(--bg-surface));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 0 var(--radius) var(--radius) 0
}

.menu-wrapper:not(:has(.scroll-right:disabled))::after {
    opacity: 1
}

#themeToggle {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    height: 40px;
    width: auto;
    padding: 5px;
    cursor: pointer;
    display: flex;
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    transition: all var(--t) var(--ease);
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-mono);
}

.info-div .image-box img,
.feat {
    width: 100%;
    height: auto;
}

.info {
    margin: 10px;
}

.deco-dialog {
    width: 600px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.deco-layout-row {
    display: flex;
    flex-direction: row;
    position: relative;
}

.deco-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    min-width: 0;
}

.vmenu {
    flex: 0 0 auto;
    width: 85px;
    display: flex;
    flex-direction: column;
    padding: 6px 4px;
    position: sticky;
    top: 120px;
    align-self: flex-start;
    height: fit-content;
    max-height: calc(90vh - 240px);
    background: transparent;
    z-index: 5;
}

.deco-dialog .vmenu {
    top: 10px;
}

.deco-mood-chip {
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 0;
    font-size: 12px;
    font-weight: bold;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    line-height: 1.3;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: all 0.15s;
    user-select: none;
    min-height: 40px;
}

.deco-mood-bar {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 0;
}

.mood-scroll-btn {
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 13px;
    padding: 6px 0;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1.4;
    touch-action: manipulation;
    user-select: none;
    height: 36px;
    width: 100%;
}

.mood-scroll-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

#decoDialog .deco-layout-row {
    padding: 0 1rem;
}

#decoDialog .deco-loadmore-wrap {
    margin-bottom: 2.5rem;
}

/* arts sec */
.art-main {
    display: flex;
}

.art-content {
    flex: 1;
}

.art-content .item {
    display: inline-block;
    align-items: center;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 5px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    aspect-ratio: 1;
    user-select: none;
    min-width: 55px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.art-content .item div {
    font-size: 1rem;
    padding: 5px;
}

.art-content .emos .item div {
    font-size: 1rem;
}

.emos .item {
    aspect-ratio: 0 !important;
    padding: 2px;
}

.arts textarea {
    height: 100%;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    font-size: 12px;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: var(--font-mono);
}

.art-content .item:hover {
    border-color: var(--accent);
}

.copied-alert {
    position: absolute;
    display: flex;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--bg-surface);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    align-items: center;
    justify-content: center;
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important
    }
}

.otools a {
    display: inline-block;
    min-height: 44px;
    padding: 10px;
    margin: 3px;
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.top-point ul {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    list-style: none;
    padding-left: 0;
}

.top-point li {
    font-size: 1.1rem;
    font-weight: bold;
    font-family: var(--font-display);
    width: 210px;
}

/* ---------- mobile-first base already applies above 600px down ---------- */

@media (min-width:720px) {

    .nav-desktop {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    .mobile-menu {
        display: none !important;
    }

    .mobile-menu.open {
        display: none !important;
    }

    #fontslist {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px
    }

    #fontslist .cat-name,
    #fontsrandom .cat-name,
    .load-more-trigger,
    .deco-loadmore-wrap,
    .menu-wrapper {
        grid-column: 1 / -1
    }

    .info-div {
        display: flex;
        align-items: flex-start;
        gap: 30px;
    }

    .image-box {
        flex: 0 0 40%;
    }

    .text-box {
        flex: 0 0 60%;
        padding-right: 10px;
    }

    .feat {
        width: 720px;
    }

    .info-div .image-box img {
        width: 100%;
    }
}

@media (max-width:600px) {

    .right-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .brand a {
        font-size: 1.1rem;
    }

    .deco-dialog {
        width: 100%;
    }

    .container {
        margin: 0 1rem;
    }

    .font p,
    .deco-loadmore-btn {
        font-size: 0.9rem;
    }

    /* smaller reticle brackets on tight phone widths so they don't
       collide between two-up cards */
    .font::before,
    .font::after {
        width: 10px;
        height: 10px;
    }

    /* keep every tap target comfortably thumb-sized on phones */
    .nav-btn,
    .btn-group button,
    .scroll-btn,
    #themeToggle,
    .hamburger {
        min-height: 40px;
    }
}

@media (max-width:380px) {
    h1 {
        font-size: 1.7rem;
    }

    .font p {
        padding: 12px 10px;
        font-size: 1.05rem;
    }
}