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

/* ══════════════════════════════════════════
   THEME TOKENS
══════════════════════════════════════════ */
:root {
    --ink:       #111;
    --ink-mid:   #555;
    --ink-soft:  #999;
    --border:    #e5e5e5;
    --surface:   #f7f7f7;
    --surface-2: #efefef;
    --bg:        #ffffff;
    --green:     #22c55e;
    --overlay:   rgba(0,0,0,0.42);
    --sh-sm:     0 2px 10px rgba(0,0,0,0.07);
    --sh-md:     0 6px 24px rgba(0,0,0,0.11);
    --sh-lg:     0 16px 48px rgba(0,0,0,0.14);
    --ease:      cubic-bezier(0.4, 0, 0.2, 1);
    --topbar-bg: rgba(255,255,255,0.92);
}

html[data-theme="dark"] {
    --ink:       #f0f0f0;
    --ink-mid:   #aaa;
    --ink-soft:  #555;
    --border:    #2c2c2c;
    --surface:   #1c1c1c;
    --surface-2: #252525;
    --bg:        #111111;
    --green:     #22c55e;
    --overlay:   rgba(0,0,0,0.62);
    --sh-sm:     0 2px 10px rgba(0,0,0,0.3);
    --sh-md:     0 6px 24px rgba(0,0,0,0.4);
    --sh-lg:     0 16px 48px rgba(0,0,0,0.5);
    --topbar-bg: rgba(17,17,17,0.92);
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════
   DARK MODE TOGGLE — fixed top-right
══════════════════════════════════════════ */
.dark-toggle {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s var(--ease), border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: var(--sh-sm);
}

.dark-toggle:hover {
    border-color: var(--ink);
    transform: scale(1.08);
    box-shadow: var(--sh-md);
}

/* Show sun in dark mode, moon in light mode */
html:not([data-theme="dark"]) .icon-sun  { display: none; }
html[data-theme="dark"]       .icon-moon { display: none; }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px 60px;
    animation: fadeIn 0.6s var(--ease) both;
}

.hero-wordmark {
    font-size: clamp(64px, 14vw, 130px);
    font-weight: 800;
    letter-spacing: clamp(-3px, -0.04em, -5px);
    line-height: 0.9;
    color: var(--ink);
    margin-bottom: 28px;
    user-select: none;
}

.hero-tag {
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 300;
    color: var(--ink-mid);
    line-height: 1.45;
    letter-spacing: -0.2px;
    margin-bottom: 14px;
}

.hero-desc {
    font-size: clamp(13px, 2vw, 15px);
    color: var(--ink-soft);
    line-height: 1.7;
    max-width: 400px;
    margin-bottom: 44px;
}

/* VS preview */
.hero-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 44px;
}

.preview-card {
    width: 72px;
    height: 72px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--surface);
}

.preview-vs {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--ink-soft);
}

.hero-cta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 18px;
}

/* Category cards */
.hero-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cat-card:hover, .cat-card:active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
    transform: translateY(-3px);
    box-shadow: var(--sh-md);
}

.cat-card:hover .cat-name,
.cat-card:active .cat-name { color: var(--bg); }

.cat-icon { font-size: 28px; line-height: 1; }

.cat-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-mid);
    transition: color 0.2s var(--ease);
}

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Topbar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 52px;
    gap: 12px;
    transition: background 0.25s var(--ease);
}

.topbar-logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--ink);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.topbar-logo:hover { opacity: 0.55; }

.topbar-cats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    justify-content: flex-end;
    /* leave room for the fixed dark-toggle on the right */
    padding-right: 52px;
}

.topbar-cats::-webkit-scrollbar { display: none; }

.topbar-cat {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    background: var(--bg);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-mid);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.18s var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    gap: 5px;
}

.topbar-cat:hover  { border-color: var(--ink); color: var(--ink); }
.topbar-cat.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.tc-icon { font-size: 15px; line-height: 1; }
.tc-text { font-size: 13px; }

/* ══════════════════════════════════════════
   MAIN / INPUT
══════════════════════════════════════════ */
.main {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    width: 100%;
}

.input-section { animation: fadeUp 0.35s var(--ease) both; }

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.input-header h2 {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.counter {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-mid);
    background: var(--surface);
    padding: 5px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Upload / URL / Camera row */
.input-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: stretch;
}

.input-side-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Camera button */
.btn-camera {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
    white-space: nowrap;
}

.btn-camera:hover {
    border-color: var(--ink);
    background: var(--surface);
    box-shadow: var(--sh-sm);
}

.btn-label { font-size: 11px; font-weight: 600; color: var(--ink-mid); }

.upload-area {
    flex: 1;
    padding: 32px 20px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--surface);
    transition: all 0.2s var(--ease);
    -webkit-tap-highlight-color: transparent;
    min-height: 110px;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--ink);
    background: var(--bg);
    box-shadow: var(--sh-sm);
}

.upload-area input { display: none; }
.upload-area svg   { color: var(--ink-soft); }
.upload-area p     { font-size: 14px; font-weight: 600; color: var(--ink); }
.upload-sub        { font-size: 12px !important; color: var(--ink-soft) !important; font-weight: 400 !important; }

.input-divider {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--ink-soft);
    flex-shrink: 0;
}

/* ── Buttons ── */
.btn-primary {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--ink);
    color: var(--bg);
    transition: all 0.18s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: var(--sh-sm); }

.btn-secondary {
    padding: 12px 18px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg);
    color: var(--ink);
    transition: all 0.18s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.btn-secondary:hover { border-color: var(--ink); box-shadow: var(--sh-sm); }

.btn-run {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--ink);
    color: var(--bg);
    letter-spacing: -0.2px;
    transition: all 0.2s var(--ease);
    margin-top: 8px;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-run:hover:not(:disabled) { opacity: 0.85; box-shadow: var(--sh-md); transform: translateY(-2px); }
.btn-run:disabled { opacity: 0.2; cursor: not-allowed; }

.btn-ghost {
    width: 100%;
    padding: 14px;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.18s var(--ease);
    margin-top: 6px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-ghost:hover { color: var(--ink); background: var(--surface); }

/* ── Text input box ── */
.text-input-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.text-input-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 10px;
}

.text-input-group { display: flex; gap: 8px; }

.text-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--bg);
    color: var(--ink);
    transition: border-color 0.18s;
    min-height: 44px;
}

.text-input-group input::placeholder { color: var(--ink-soft); }
.text-input-group input:focus { outline: none; border-color: var(--ink); }
.text-input-group .btn-primary { flex-shrink: 0; }

/* ── Items grid ── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.item-card {
    position: relative;
    aspect-ratio: 1;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    transition: all 0.2s var(--ease);
    animation: popIn 0.22s cubic-bezier(0.34,1.56,0.64,1) both;
    -webkit-tap-highlight-color: transparent;
}

.item-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--sh-md); }
.item-card img { width: 100%; height: 100%; object-fit: cover; }

.item-card.text {
    flex-direction: column;
    padding: 10px;
    text-align: center;
    background: var(--surface-2);
    gap: 4px;
}

.item-card.text::before {
    content: 'Aa';
    font-size: 16px;
    font-weight: 800;
    color: var(--ink-soft);
    line-height: 1;
}

.item-card.text span {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
    line-height: 1.3;
}

.item-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    line-height: 1;
}

.item-card:hover .item-remove { opacity: 1; }
.item-remove:hover { background: #000; }

/* Touch: always show remove on touch devices */
@media (hover: none) {
    .item-remove { opacity: 1; background: rgba(0,0,0,0.55); }
}

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: flex-end; /* sheet from bottom on mobile */
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.18s ease;
    padding: 0;
}

.modal.hidden { display: none; }

.modal-content {
    background: var(--bg);
    padding: 32px 24px 28px;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--sh-lg);
    animation: slideUp 0.25s var(--ease);
}

/* Pill handle */
.modal-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 24px;
}

.modal-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 18px; }

.modal-close {
    float: right;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    color: var(--ink-soft);
    line-height: 1;
    transition: color 0.15s;
    padding: 4px;
}

.modal-close:hover { color: var(--ink); }

.modal-content input {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 14px;
    background: var(--bg);
    color: var(--ink);
    transition: border-color 0.18s;
    min-height: 48px;
}

.modal-content input::placeholder { color: var(--ink-soft); }
.modal-content input:focus { outline: none; border-color: var(--ink); }
.modal-content .btn-primary { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

/* ══════════════════════════════════════════
   TOURNAMENT
══════════════════════════════════════════ */
.tournament-section {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 52px);
    justify-content: center;
    padding: 24px 0 32px;
    animation: fadeIn 0.35s var(--ease);
}

.tournament-info {
    text-align: center;
    margin-bottom: 32px;
}

.round-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: var(--surface);
    padding: 5px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.progress-bar {
    height: 3px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--ink);
    transition: width 0.5s var(--ease);
}

.pick-hint { font-size: 13px; color: var(--ink-soft); }

/* ── Match cards ── */
.matchup-container {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    align-items: center;
}

.shoe-card {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.shoe-card:hover {
    border-color: var(--ink);
    transform: scale(1.03);
    box-shadow: var(--sh-lg);
    z-index: 2;
}

/* Active/tap state for touch */
.shoe-card:active {
    transform: scale(0.98);
}

.card-pick-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 3px;
    opacity: 0;
    transition: opacity 0.16s ease;
    border-radius: inherit;
}

.shoe-card:hover .card-pick-overlay { opacity: 1; }

/* On touch: show PICK hint as a small floating label instead */
@media (hover: none) {
    .card-pick-overlay { display: none; }
}

.shoe-card.selected {
    border-color: var(--ink);
    transform: scale(1.04);
    animation: cardPulse 0.32s var(--ease) forwards;
}

@keyframes cardPulse {
    0%   { box-shadow: 0 0 0 0   rgba(0,0,0,0.2); }
    50%  { box-shadow: 0 0 0 8px rgba(0,0,0,0.08); }
    100% { box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }
}

.card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px 12px;
}

.card-inner img {
    flex: 1;
    width: 100%;
    object-fit: contain;
    min-height: 0;
}

.card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-mid);
    text-align: center;
    margin-top: 8px;
    word-break: break-word;
    line-height: 1.35;
}

.shoe-card.text-item .text-display {
    font-size: clamp(14px, 3.5vw, 24px);
    font-weight: 700;
    text-align: center;
    color: var(--ink);
    word-break: break-word;
    line-height: 1.3;
    padding: 0 10px;
}

.vs-divider {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink-soft);
    text-align: center;
    letter-spacing: 1.5px;
}

/* ══════════════════════════════════════════
   RESULTS
══════════════════════════════════════════ */
.results-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100svh - 52px);
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.45s var(--ease);
}

.winner-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 18px;
}

.winner-visual {
    width: min(320px, 76vw);
    height: min(320px, 76vw);
    border-radius: 16px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    box-shadow: var(--sh-lg);
    margin: 0 auto 20px;
    animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

#winnerImg { width: 100%; height: 100%; object-fit: contain; padding: 20px; }

.winner-text-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    font-size: clamp(20px, 5vw, 36px);
    font-weight: 800;
    padding: 24px;
    word-break: break-word;
    line-height: 1.2;
    color: var(--ink);
}

.winner-label {
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}

.winner-message {
    font-size: 15px;
    color: var(--ink-mid);
    line-height: 1.75;
    max-width: 420px;
    margin: 0 auto 28px;
}

.winner-message.highlight {
    background: var(--green);
    color: #fff;
    font-weight: 700;
    padding: 16px 22px;
    border-radius: 12px;
    animation: slideDown 0.3s var(--ease);
}

.result-actions { width: min(300px, 88vw); }

/* ══════════════════════════════════════════
   START / CONFIRM
══════════════════════════════════════════ */
.start-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100svh - 52px);
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.35s var(--ease);
}

.start-count {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 12px;
}

.start-section h2 {
    font-size: clamp(34px, 8vw, 54px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 32px;
}

.start-actions { width: min(300px, 88vw); }

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn     { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: scale(1); } }

/* ══════════════════════════════════════════
   MOBILE  ≤ 600px
══════════════════════════════════════════ */
@media (max-width: 600px) {

    /* Hero */
    .hero { padding: 72px 20px 56px; justify-content: flex-start; padding-top: 80px; }
    .hero-desc br { display: none; }
    .hero-preview { gap: 12px; margin-bottom: 36px; }
    .preview-card { width: 60px; height: 60px; font-size: 18px; }
    .hero-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 300px;
    }
    .cat-card { padding: 18px 10px; gap: 7px; }
    .cat-icon { font-size: 26px; }

    /* Topbar: icons only */
    .tc-text { display: none; }
    .topbar-cat { padding: 7px 11px; }
    .tc-icon { font-size: 17px; }

    /* Input */
    .main { padding: 28px 16px 60px; }
    .input-controls { flex-direction: column; gap: 10px; }
    .input-side-btns { flex-direction: row; }
    .input-side-btns .btn-camera,
    .input-side-btns .btn-secondary { flex: 1; flex-direction: row; padding: 13px 12px; gap: 8px; }
    .btn-label { font-size: 13px; }
    .upload-area { padding: 28px 16px; }
    .text-input-section { padding: 16px; }
    .text-input-group { flex-direction: column; }
    .text-input-group .btn-primary { width: 100%; justify-content: center; }

    /* Grid: 3 columns on mobile */
    .items-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

    /* Tournament: stack vertically */
    .matchup-container {
        display: flex;
        flex-direction: column;
        gap: 0;
        max-width: 280px;
        margin: 0 auto;
    }

    .shoe-card {
        aspect-ratio: unset;
        height: 200px;
        width: 100%;
    }

    .vs-divider { padding: 10px 0; font-size: 12px; }

    /* Topbar: show only emoji on small screens */
    .topbar-cat { padding: 5px 10px; font-size: 12px; }

    /* Modal: full sheet on mobile already handled by align-items: flex-end */
    .modal-content { border-radius: 20px 20px 0 0; max-width: 100%; }
}

/* Tiny phones */
@media (max-width: 380px) {
    .topbar-cats { padding-right: 48px; }
    .items-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
    .shoe-card { height: 170px; }
}
