/* ============================================
   MASTERSHOT — COMPONENTS
   ============================================ */

/* === APP SHELL === */
#app {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(232,185,73,.04) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(63,160,117,.04) 0%, transparent 60%),
        var(--ink-950);
}

.screen {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-slow) var(--ease-out);
}
.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* === VIGNETTE OVERLAY === */
.vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.5) 100%);
    z-index: 50;
}

/* === AMBIENT PARTICLES (dust/felt motes) === */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold-400);
    border-radius: 50%;
    opacity: 0;
    filter: blur(0.5px);
    box-shadow: 0 0 4px var(--gold-500);
}

/* ============================================
   BUTTONS
   ============================================ */

/* === PRIMARY: Brass === */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-900);
    background: var(--g-gold);
    border-radius: var(--r-md);
    box-shadow: var(--sh-gold), inset 0 1px 0 rgba(255,255,255,.4), inset 0 -2px 0 rgba(0,0,0,.3);
    transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), filter var(--t-fast);
    user-select: none;
    white-space: nowrap;
}
.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(110deg,
        transparent 20%,
        rgba(255,255,255,.55) 35%,
        rgba(255,255,255,.8) 50%,
        rgba(255,255,255,.55) 65%,
        transparent 80%);
    background-size: 250% 100%;
    background-position: 200% 0;
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--t-med) var(--ease-out);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--sh-gold), var(--sh-gold-glow), inset 0 1px 0 rgba(255,255,255,.5);
    filter: brightness(1.08);
}
.btn:hover::before {
    opacity: 1;
    animation: shimmer 1.4s var(--ease-out);
}
.btn:active {
    transform: translateY(0);
    box-shadow: var(--sh-gold), inset 0 2px 6px rgba(0,0,0,.5);
}

/* === SECONDARY: Leather === */
.btn-ghost {
    padding: 13px 26px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-200);
    background: var(--g-panel-raised);
    border: 1px solid var(--ink-600);
    border-radius: var(--r-md);
    box-shadow: var(--sh-md), var(--sh-inset);
    transition: all var(--t-fast) var(--ease-out);
}
.btn-ghost:hover {
    color: var(--gold-300);
    border-color: var(--gold-700);
    background: var(--g-panel);
    transform: translateY(-1px);
    box-shadow: var(--sh-lg), 0 0 0 1px var(--gold-800);
}

/* === ICON BUTTON (round) === */
.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--g-panel-raised);
    border: 1px solid var(--ink-600);
    color: var(--ink-200);
    box-shadow: var(--sh-md);
    transition: all var(--t-fast) var(--ease-out);
}
.btn-icon:hover {
    color: var(--gold-400);
    border-color: var(--gold-700);
    box-shadow: var(--sh-md), 0 0 12px rgba(232,185,73,.25);
}

/* === LARGE CTA (title screen) === */
.btn-cta {
    padding: 18px 48px;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-900);
    background: var(--g-gold);
    border-radius: var(--r-md);
    box-shadow:
        0 0 0 2px var(--gold-800),
        0 0 0 4px var(--ink-900),
        0 0 0 5px var(--gold-700),
        0 16px 40px rgba(232,185,73,.35),
        inset 0 2px 0 rgba(255,255,255,.5),
        inset 0 -3px 0 rgba(0,0,0,.3);
    position: relative;
    overflow: hidden;
    transition: all var(--t-med) var(--ease-out);
}
.btn-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
        transparent 30%,
        rgba(255,255,255,.6) 50%,
        transparent 70%);
    background-size: 200% 100%;
    background-position: -100% 0;
    animation: shimmer 3s var(--ease-inout) infinite;
    pointer-events: none;
}
.btn-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 0 0 2px var(--gold-600),
        0 0 0 4px var(--ink-900),
        0 0 0 5px var(--gold-500),
        0 24px 60px rgba(232,185,73,.5),
        inset 0 2px 0 rgba(255,255,255,.6);
}

/* ============================================
   CARDS & PANELS
   ============================================ */

.panel {
    background: var(--g-panel);
    border: 1px solid var(--ink-700);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xl), var(--sh-inset);
    position: relative;
    overflow: hidden;
}
.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-700), transparent);
    opacity: .6;
}

.panel-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--ink-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(180deg, rgba(0,0,0,.2), transparent);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-400);
}

.panel-body {
    padding: 24px 28px;
}

/* ============================================
   FORM CONTROLS
   ============================================ */

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-300);
}

.input, .select {
    padding: 12px 16px;
    background: var(--ink-900);
    border: 1px solid var(--ink-600);
    border-radius: var(--r-sm);
    color: var(--ink-100);
    font-size: 14px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    width: 100%;
}
.input:focus, .select:focus {
    outline: none;
    border-color: var(--gold-600);
    box-shadow: 0 0 0 3px rgba(232,185,73,.15);
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%23c4b498' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* === TOGGLE SWITCH === */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--ink-700);
    border: 1px solid var(--ink-600);
    border-radius: var(--r-full);
    transition: all var(--t-med) var(--ease-out);
    cursor: pointer;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--ink-300);
    border-radius: 50%;
    transition: all var(--t-med) var(--ease-out);
    box-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.toggle input:checked + .toggle-slider {
    background: var(--g-gold);
    border-color: var(--gold-700);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: var(--ink-900);
}

/* === SLIDER === */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--ink-800);
    border: 1px solid var(--ink-700);
    border-radius: var(--r-full);
    outline: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--g-gold);
    border: 1px solid var(--gold-800);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--sh-md);
}
.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--g-gold);
    border: 1px solid var(--gold-800);
    border-radius: 50%;
    cursor: pointer;
}

/* ============================================
   BADGES & CHIPS
   ============================================ */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-200);
    background: rgba(0,0,0,.4);
    border: 1px solid var(--ink-600);
    border-radius: var(--r-full);
}
.chip-gold {
    color: var(--gold-300);
    border-color: var(--gold-700);
    background: rgba(232,185,73,.08);
}
.chip-win {
    color: var(--win-bright);
    border-color: rgba(63,160,117,.4);
    background: rgba(63,160,117,.12);
}
.chip-fire {
    color: var(--fire-bright);
    border-color: rgba(255,122,45,.4);
    background: rgba(255,122,45,.12);
}

/* === STREAK FLAME BADGE === */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 6px;
    border-radius: var(--r-full);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, var(--fire-bright), var(--fire-deep));
    box-shadow:
        0 0 0 1px rgba(255,255,255,.15),
        0 2px 6px rgba(217,74,15,.5),
        inset 0 1px 0 rgba(255,255,255,.3);
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
    position: relative;
}
.streak-badge.cold {
    background: linear-gradient(180deg, var(--ink-500), var(--ink-700));
    box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 1px 3px rgba(0,0,0,.4);
    color: var(--ink-200);
}
.streak-badge.hot {
    background: linear-gradient(180deg, #ffca7a, var(--fire-bright), var(--fire-deep));
    box-shadow:
        0 0 0 1px rgba(255,200,100,.4),
        0 0 16px rgba(255,122,45,.5),
        0 2px 6px rgba(217,74,15,.6);
    animation: flame-flicker 1.8s ease-in-out infinite;
}
.streak-flame {
    width: 14px;
    height: 14px;
    display: inline-block;
    filter: drop-shadow(0 0 2px rgba(255,200,100,.6));
}

/* === COIN / CHIP DISPLAY === */
.currency {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: var(--ink-900);
    border: 1px solid var(--ink-600);
    border-radius: var(--r-full);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.currency-coin {
    color: var(--gold-300);
    border-color: var(--gold-800);
}
.currency-chip {
    color: #ff6b9d;
    border-color: rgba(255,107,157,.35);
}
.currency-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
}
.currency-icon.coin {
    background: var(--g-gold-shiny);
    color: var(--ink-900);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 3px rgba(0,0,0,.3);
}
.currency-icon.chip {
    background: linear-gradient(135deg, #ff9ec4, #e03a78);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 3px rgba(0,0,0,.4);
}

/* ============================================
   AVATAR / LEVEL
   ============================================ */

.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--g-panel-raised);
    border: 2px solid var(--gold-700);
    box-shadow: var(--sh-md);
    overflow: hidden;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gold-300);
    flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; font-size: 13px; border-width: 1px; }
.avatar-md { width: 52px; height: 52px; font-size: 18px; }
.avatar-lg { width: 84px; height: 84px; font-size: 28px; }
.avatar-xl { width: 140px; height: 140px; font-size: 48px; border-width: 3px; }

.level-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    pointer-events: none;
}
.level-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--g-gold-shiny);
    color: var(--ink-900);
    border: 2px solid var(--ink-900);
    border-radius: var(--r-full);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sh-sm);
}

/* ============================================
   TOPBAR (persistent header in logged-in screens)
   ============================================ */

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(180deg, rgba(10,8,5,.9) 0%, rgba(10,8,5,.4) 70%, transparent 100%);
    backdrop-filter: blur(8px);
    z-index: 30;
}
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.logo-text {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--gold-300);
    text-shadow: 0 1px 0 rgba(0,0,0,.6);
}

/* ============================================
   BACK BUTTON
   ============================================ */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    color: var(--ink-200);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(0,0,0,.4);
    border: 1px solid var(--ink-600);
    border-radius: var(--r-full);
    transition: all var(--t-fast);
}
.back-btn:hover {
    color: var(--gold-300);
    border-color: var(--gold-700);
}

/* ============================================
   NAV TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ink-700);
    padding: 0 4px;
}
.tab {
    padding: 14px 20px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-300);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--t-fast);
    cursor: pointer;
}
.tab:hover { color: var(--ink-100); }
.tab.active {
    color: var(--gold-400);
    border-bottom-color: var(--gold-500);
}
