/* =============================================================================
   COINFLIP - Premium Casino Betting UI
   Luxury dark aesthetic with gold accents
============================================================================= */

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none !important
}

*::selection {
    background: rgba(212, 175, 55, 0.25)
}

html,
body {
    background: transparent;
    font-family: 'Geist', -apple-system, sans-serif;
    color: #fafafa;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

:root {
    --bg-deep: #09090b;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-elevated: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.07);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --gold: #d4af37;
    --gold-light: #f0d77a;
    --gold-dark: #a68a2a;
    --gold-glow: rgba(212, 175, 55, 0.15);
    --silver: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(212, 175, 55, 0.25);
    --text: #fafafa;
    --text-dim: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --success: #4ade80;
    --danger: #f87171;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0
    }

    100% {
        background-position: 200% 0
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-8px)
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.5
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--gold-glow), 0 0 40px transparent
    }

    50% {
        box-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow)
    }
}

@keyframes spin3d {
    0% {
        transform: rotateY(0deg)
    }

    100% {
        transform: rotateY(var(--rotations, 1800deg))
    }
}

@keyframes coinBounce {
    0% {
        transform: rotateY(var(--final-rot)) translateY(0)
    }

    25% {
        transform: rotateY(var(--final-rot)) translateY(-12px)
    }

    50% {
        transform: rotateY(var(--final-rot)) translateY(0)
    }

    75% {
        transform: rotateY(var(--final-rot)) translateY(-6px)
    }

    100% {
        transform: rotateY(var(--final-rot)) translateY(0)
    }
}

@keyframes winPulse {
    0% {
        transform: scale(0.5);
        opacity: 0
    }

    60% {
        transform: scale(1.1)
    }

    100% {
        transform: scale(1);
        opacity: 1
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(212, 175, 55, 0.3)
    }

    50% {
        border-color: rgba(212, 175, 55, 0.6)
    }
}

@keyframes itemsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0
    }

    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 300px
    }
}

@keyframes chipPop {
    0% {
        opacity: 0;
        transform: scale(0.8)
    }

    50% {
        transform: scale(1.05)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes chipRemove {
    0% {
        opacity: 1;
        transform: scale(1);
        max-width: 300px;
        margin-right: 6px
    }

    50% {
        opacity: 0;
        transform: scale(0.8)
    }

    100% {
        opacity: 0;
        transform: scale(0.6);
        max-width: 0;
        padding: 0;
        margin: 0;
        border-width: 0
    }
}

/* === CONTAINER === */
.container {
    position: fixed;
    width: 460px;
    height: 680px;
    background: var(--bg-deep);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.03);
    animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.container.closing {
    animation: scaleIn 0.2s ease reverse forwards
}

/* === HEADER === */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    cursor: move;
    position: relative;
    z-index: 10;
}

.header-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text);
    text-transform: uppercase;
}

.close-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
}

.tab:hover {
    color: var(--text-dim);
    background: var(--bg-hover)
}

.tab.active {
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

/* === CONTENT === */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.content::-webkit-scrollbar {
    width: 4px
}

.content::-webkit-scrollbar-track {
    background: transparent
}

.content::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 2px
}

/* === VIEWS === */
.view {
    display: none;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateY(10px);
}

.view.active {
    display: flex;
    animation: slideUp 0.3s ease forwards;
}

/* === GAME LIST === */
.games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.games-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.games-count {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 20px;
}

.game-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0;
    animation: slideUp 0.4s ease forwards;
}

.game-card:nth-child(1) {
    animation-delay: 0.05s
}

.game-card:nth-child(2) {
    animation-delay: 0.1s
}

.game-card:nth-child(3) {
    animation-delay: 0.15s
}

.game-card:nth-child(4) {
    animation-delay: 0.2s
}

.game-card:nth-child(5) {
    animation-delay: 0.25s
}

.game-card:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.game-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dim);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.game-info {
    flex: 1;
    min-width: 0
}

.game-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.game-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px
}

.game-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    margin-right: 10px;
}

.game-side {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-side.heads {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    color: var(--gold);
    border: 1px solid var(--border-gold);
}

.game-side.tails {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.15), rgba(156, 163, 175, 0.05));
    color: var(--silver);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-muted);
    animation: float 3s ease-in-out infinite;
}

.empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6
}

/* === CREATE FORM === */
.form-section {
    margin-bottom: 20px
}

.form-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    display: block;
}

.input-wrapper {
    position: relative
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Geist', sans-serif;
    font-size: 20px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.input-wrapper input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow), 0 0 20px -5px var(--gold-glow);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400
}

.input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--gold);
    font-weight: 600;
}

.side-picker {
    display: flex;
    gap: 10px
}

.side-option {
    flex: 1;
    padding: 14px 12px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.side-option:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.side-option.selected {
    transform: translateY(-2px);
}

.side-option.selected.heads {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--gold);
}

.side-option.selected.tails {
    background: rgba(156, 163, 175, 0.08);
    border-color: var(--silver);
}

.side-coin {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.15), 0 3px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.side-option:hover .side-coin {
    transform: scale(1.05)
}

.side-option.heads .side-coin {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: rgba(0, 0, 0, 0.5);
}

.side-option.tails .side-coin {
    background: linear-gradient(135deg, var(--silver), #6b7280);
    color: rgba(0, 0, 0, 0.5);
}

.side-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim)
}

.total-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.total-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.btn-row {
    display: flex;
    gap: 10px
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 10px;
    border: none;
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0a0a0c;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-sm {
    flex: none;
    padding: 10px 24px;
    font-size: 12px;
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
}

/* === WAITING === */
.waiting-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: center;
}

.waiting-coin {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    animation: glow 2s ease-in-out infinite, float 3s ease-in-out infinite;
    box-shadow: inset 0 3px 12px rgba(255, 255, 255, 0.2), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.waiting-coin.heads {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: rgba(0, 0, 0, 0.4)
}

.waiting-coin.tails {
    background: linear-gradient(135deg, var(--silver), #6b7280);
    color: rgba(0, 0, 0, 0.4)
}

.waiting-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    animation: pulse 2s ease-in-out infinite;
}

.waiting-dots {
    display: inline-block
}

.waiting-dots span {
    animation: pulse 1.5s ease-in-out infinite;
}

.waiting-dots span:nth-child(2) {
    animation-delay: 0.2s
}

.waiting-dots span:nth-child(3) {
    animation-delay: 0.4s
}

.waiting-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
}

/* === FLIPPING === */
.flip-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.players-vs {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 32px;
}

.player-box {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.player-box::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
}

.player-box.winner {
    border-color: var(--success);
    box-shadow: 0 0 30px -8px rgba(74, 222, 128, 0.4);
}

.player-box.winner::before {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), transparent);
    opacity: 1;
}

.player-box.loser {
    opacity: 0.4
}

.player-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative
}

.player-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    position: relative
}

.player-side {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 6px;
    position: relative
}

.vs-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.coin-stage {
    perspective: 1200px;
    width: 130px;
    height: 130px;
    margin: 24px 0;
}

.coin-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

.coin-3d.spinning {
    animation: spin3d var(--duration, 3.5s) cubic-bezier(0.12, 0.75, 0.2, 1) forwards;
}

.coin-3d.landed {
    animation: coinBounce 0.6s ease forwards;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    box-shadow: inset 0 4px 16px rgba(255, 255, 255, 0.25), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.coin-face.heads {
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    color: rgba(0, 0, 0, 0.35);
}

.coin-face.tails {
    background: linear-gradient(135deg, #d1d5db, var(--silver), #6b7280);
    color: rgba(0, 0, 0, 0.35);
    transform: rotateY(180deg);
}

/* === RESULT === */
.result-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
}

.result-badge {
    font-size: 36px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: winPulse 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-badge.win {
    color: var(--success);
    text-shadow: 0 0 40px rgba(74, 222, 128, 0.5);
}

.result-badge.lose {
    color: var(--danger);
    text-shadow: 0 0 40px rgba(248, 113, 113, 0.3);
}

.result-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--gold);
    animation: winPulse 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.result-side {
    font-size: 12px;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease 0.2s backwards;
}

.result-coin {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    animation: winPulse 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.result-coin.heads {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: rgba(0, 0, 0, 0.4)
}

.result-coin.tails {
    background: linear-gradient(135deg, var(--silver), #6b7280);
    color: rgba(0, 0, 0, 0.4)
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti 3s ease-out forwards;
    pointer-events: none;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--danger);
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 12px;
    font-weight: 500;
    color: var(--danger);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

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

/* === ITEM PICKER === */
.add-items-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-items-btn:hover {
    border-color: var(--gold);
    border-style: solid;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.add-items-btn .plus {
    font-size: 16px;
    font-weight: 300;
}

.selected-items-wrap {
    margin-bottom: 16px;
    animation: itemsSlideIn 0.3s ease forwards;
}

.selected-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.selected-items-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selected-items-count {
    font-size: 10px;
    color: var(--text-muted);
}

.selected-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-dim);
    animation: chipPop 0.25s ease forwards;
    overflow: hidden;
    max-width: 300px;
    transition: all 0.2s ease;
}

.selected-chip.removing {
    animation: chipRemove 0.25s ease forwards;
    pointer-events: none;
}

.selected-chip .chip-value {
    color: var(--gold);
    font-weight: 600;
}

.selected-chip .chip-remove {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.selected-chip .chip-remove:hover {
    background: rgba(248, 113, 113, 0.25)
}

/* Active game banner */
.active-game-banner {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    animation: slideUp 0.3s ease;
}

.active-game-banner .agb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.active-game-banner .agb-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-game-banner .agb-timer {
    font-size: 11px;
    color: var(--text-muted);
}

.active-game-banner .agb-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.active-game-banner .agb-info {
    flex: 1
}

.active-game-banner .agb-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
}

.active-game-banner .agb-side {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.active-game-banner .agb-cancel {
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--danger);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.active-game-banner .agb-cancel:hover {
    background: rgba(248, 113, 113, 0.15);
}

/* Bot weapons note */
.bot-weapons-note {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

/* === MODAL === */
.modal {
    position: fixed;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 320px;
    height: 480px;
    display: none;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    z-index: 1001;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.show {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
}

.modal-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
}

.modal-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-close:hover {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger)
}

.modal-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-body::-webkit-scrollbar {
    width: 4px
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 2px
}

.modal-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-footer-info {
    font-size: 11px;
    color: var(--text-muted);
}

.modal-footer-info strong {
    color: var(--gold);
    font-weight: 600;
}

/* Item grid */
.item-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.item-card:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.item-card.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

.item-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #0a0a0c;
}

.item-card .item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    padding-right: 20px;
}

.item-card .item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.item-card .item-rarity {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 6px;
    border-radius: 4px;
}

.item-card .item-rarity.basic {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af
}

.item-card .item-rarity.advanced {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e
}

.item-card .item-rarity.superior {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6
}

.item-card .item-rarity.arcane {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7
}

.item-card .item-rarity.apex {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b
}

.item-card .item-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
}

.empty-items {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 12px;
}