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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    color: #fff;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex !important; }

/* Menu Screen */
#menu-screen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a1a2e, #0a0a0f);
}

.game-title {
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(251, 191, 36, 0.3);
    margin-bottom: 0.5rem;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.game-subtitle {
    color: #a0a0b0;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

.menu-container {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
    padding: 2.5rem 3.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(251, 191, 36, 0.1);
}

.player-count-selector { display: flex; justify-content: center; gap: 0.8rem; margin-bottom: 1.5rem; }

.count-btn {
    padding: 0.8rem 1.8rem;
    background: linear-gradient(145deg, #1a1a25, #151520);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s;
    min-width: 70px;
}
.count-btn.active {
    border-color: #fbbf24;
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}
.count-btn:hover:not(.active) { background: #2a2a35; border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }

.nickname-input { margin-bottom: 1.5rem; }
.nickname-input input {
    width: 260px;
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    background: linear-gradient(145deg, #1a1a25, #151520);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}
.nickname-input input:focus { outline: none; border-color: #fbbf24; box-shadow: 0 0 15px rgba(251, 191, 36, 0.2); }
.nickname-input input::placeholder { color: #666; }

.btn {
    display: block;
    width: 260px;
    padding: 1rem;
    margin: 0.6rem auto;
    font-size: 1.1rem;
    background: linear-gradient(145deg, #1a1a25, #151520);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn:hover { background: linear-gradient(145deg, #fbbf24, #f59e0b); color: #000; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3); }
.btn-primary {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #000;
    border-color: #fbbf24;
    font-weight: bold;
}
.btn-primary:hover { background: linear-gradient(145deg, #f59e0b, #fbbf24); box-shadow: 0 8px 30px rgba(251, 191, 36, 0.5); }

/* Online Menu */
.online-menu, .room-lobby {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
    padding: 2.5rem 3.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(251, 191, 36, 0.1);
    min-width: 400px;
}

#room-title { color: #fbbf24; margin-bottom: 1rem; }

/* Game Screen Layout */
#game-screen { flex-direction: row; }

/* Left Sidebar - History (Collapsible) */
.sidebar-left {
    width: 260px;
    background: linear-gradient(180deg, rgba(20, 20, 35, 0.98), rgba(15, 15, 25, 0.95));
    border-right: 1px solid rgba(251, 191, 36, 0.15);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
}

.sidebar-left.collapsed { width: 40px; }

.sidebar-toggle-top {
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    width: 24px;
    height: 50px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(245, 158, 11, 0.9));
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    color: #000;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.sidebar-toggle-top:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.sidebar-left.collapsed .sidebar-toggle-top {
    position: static;
    width: 100%;
    height: 40px;
    border-radius: 0;
    transform: none;
    margin-top: auto;
}

.sidebar-toggle-top::before {
    content: '◀';
}

.sidebar-left.collapsed .sidebar-toggle-top::before {
    content: '▶';
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s;
}

.sidebar-left.collapsed .history-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: bold;
    color: #fbbf24;
    text-align: center;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.history-item:hover { background: rgba(255, 255, 255, 0.08); }
.history-item .history-round { color: #888; font-size: 0.7rem; margin-bottom: 0.2rem; }
.history-item .history-main { display: flex; justify-content: space-between; align-items: center; }
.history-item .history-artist { font-weight: bold; }
.history-item .history-price { color: #4ade80; font-weight: bold; }
.history-item .history-winner { color: #fbbf24; font-size: 0.75rem; }
.history-empty { color: #666; text-align: center; font-size: 0.85rem; padding: 2rem 1rem; }

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(180deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.9));
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.round-info { font-size: 1rem; }
.round-info span { color: #fbbf24; font-weight: bold; font-size: 1.2rem; }

.top-center-info { display: flex; align-items: center; }

.auctioneer-display {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.top-right-info { display: flex; gap: 1rem; }

.info-badge {
    background: linear-gradient(145deg, #1a1a25, #151520);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.info-badge span { color: #fbbf24; font-weight: bold; }

/* Game Table - centered layout with players around auction area */
.game-table {
    flex: 1;
    display: flex;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(30, 30, 50, 0.5), transparent);
    border-radius: 16px;
    padding: 1rem;
    min-height: 300px;
}

/* Individual player position containers */
.player-pos {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 130px;
}

/* Player positions - absolute around center */
.player-pos-left {
    position: absolute;
    left: 1rem;
    top: 35%;
    transform: translateY(-50%);
}

.player-pos-right {
    position: absolute;
    right: 1rem;
    top: 35%;
    transform: translateY(-50%);
}

.player-pos-front-left {
    position: absolute;
    left: 25%;
    top: 0.3rem;
    transform: translateX(-50%);
}

.player-pos-front-right {
    position: absolute;
    right: 25%;
    top: 0.3rem;
    transform: translateX(50%);
}

/* Auction Area - centered in table */
.auction-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 350px;
    z-index: 10;
}

/* Player Card */
.player-card {
    background: linear-gradient(145deg, rgba(25, 25, 40, 0.95), rgba(15, 15, 25, 0.98));
    padding: 0.8rem 1rem;
    border-radius: 16px;
    border: 2px solid transparent;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.player-card.auctioneer { border-color: #10b981; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
.player-card.active-turn { border-color: #fbbf24; box-shadow: 0 0 25px rgba(251, 191, 36, 0.5); animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.5); }
    50% { box-shadow: 0 0 35px rgba(251, 191, 36, 0.7); }
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    border: 3px solid rgba(255, 255, 255, 0.3);
}
.avatar-0 { background: linear-gradient(135deg, #667eea, #764ba2); }
.avatar-1 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.avatar-2 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.avatar-3 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.avatar-4 { background: linear-gradient(135deg, #fa709a, #fee140); }

.player-card-name { font-weight: bold; font-size: 0.9rem; margin-bottom: 0.3rem; }
.player-card-money { color: #fbbf24; font-size: 0.85rem; font-weight: bold; }
.player-card-cards { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 0.4rem; min-height: 30px; }

.mini-card {
    width: 22px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: #fff;
}

/* Auction Area */
.auction-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    z-index: 10;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.98), rgba(10, 10, 20, 0.99));
    padding: 1.2rem 2rem;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.auction-card-display {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auction-card {
    width: 90px;
    height: 120px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    position: relative;
}

.auction-card-type {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
}

.auction-card-value {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.auction-card-artist {
    font-size: 0.85rem;
    opacity: 0.9;
}

.auction-placeholder {
    text-align: center;
    color: #888;
    padding: 2rem;
}

.auction-placeholder .auctioneer-name { color: #4ade80; font-size: 1.1rem; margin-bottom: 0.5rem; }

/* Auction Header */
.auction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 1rem;
}

.auction-from {
    color: #888;
    font-size: 0.85rem;
}

.auction-turn {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0b0;
}

.auction-turn.my-turn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* Bid Bubble - prominent price display */
.bid-bubble {
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.15));
    border: 2px solid #4ade80;
    border-radius: 16px;
    padding: 0.8rem 1.5rem;
    text-align: center;
    margin: 0.8rem 0;
    animation: bubblePop 0.3s ease-out;
}

@keyframes bubblePop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.bid-bubble-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.2rem;
}

.bid-bubble-amount {
    font-size: 2rem;
    font-weight: bold;
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.bid-bubble-bidder {
    font-size: 0.8rem;
    color: #a0a0b0;
    margin-top: 0.3rem;
}

/* Auction Timer */
.auction-timer {
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    color: #fbbf24;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Card winning animation */
.card-winning {
    animation: cardWinPulse 0.5s ease-out;
}

@keyframes cardWinPulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    50% { box-shadow: 0 0 30px 10px rgba(74, 222, 128, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Card flying animation to winner */
@keyframes cardFlyToWinner {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(var(--fly-x), var(--fly-y)) scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--fly-x), var(--fly-y)) scale(0.3);
        opacity: 0;
    }
}

.auction-card.flying {
    animation: cardFlyToWinner 0.6s ease-in forwards;
}

@keyframes toastFade {
    0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.bid-display {
    text-align: center;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.bid-display .current-bid {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ade80;
}

.bid-display .bidder-name {
    color: #fbbf24;
    font-size: 0.9rem;
}

.bid-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.bid-controls input {
    width: 80px;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-align: center;
    font-size: 1rem;
}

.bid-controls button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-bid {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #000;
}
.btn-bid:hover { transform: scale(1.05); }

.btn-pass {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}
.btn-pass:hover { transform: scale(1.05); }

.my-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    margin-bottom: 0.5rem;
}

.my-name { font-weight: bold; font-size: 1rem; margin-bottom: 0.3rem; }

.my-money {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.my-section-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.my-won-cards {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 0.3rem;
}

.my-won-cards .empty-hint {
    color: #555;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem 0;
}

.won-card-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.3rem;
    border-left: 3px solid;
}

.won-card-item .won-artist { font-weight: bold; font-size: 0.85rem; }
.won-card-item .won-price { color: #4ade80; font-size: 0.75rem; }
.won-card-item .won-value { color: #fbbf24; font-size: 0.7rem; }

/* Bottom Panel: Won Cards + Hand Cards + My Info */
.bottom-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 1rem;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.95), rgba(10, 10, 20, 0.98));
    border-top: 1px solid rgba(251, 191, 36, 0.15);
}

/* Won Cards Panel (above hand cards) */
.won-cards-panel {
    background: linear-gradient(145deg, rgba(25, 25, 40, 0.95), rgba(15, 15, 25, 0.98));
    border-radius: 16px;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
    max-height: 140px;
    overflow-y: auto;
}

.won-cards-panel .panel-title {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.won-cards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.won-cards-list .empty-hint {
    color: #555;
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem 1rem;
}

/* Mini Won Cards (grouped by artist) */
.won-card-mini {
    width: 48px;
    height: 62px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.won-card-mini .card-value {
    font-size: 1rem;
    font-weight: bold;
}

.won-card-mini .card-artist {
    font-size: 0.5rem;
    opacity: 0.9;
}

/* My Info Panel (bottom-right) */
.my-info-panel {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(145deg, rgba(25, 25, 40, 0.95), rgba(15, 15, 25, 0.98));
    border-radius: 16px;
    padding: 0.6rem 1.2rem;
    border: 2px solid rgba(251, 191, 36, 0.3);
}

.my-info-panel .my-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    border: 2px solid #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.my-info-panel .my-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.my-info-panel .my-money {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Hand Cards Area (part of bottom panel, center/left) */
.hand-cards-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.5rem 1rem;
    min-width: 300px;
}

.artist-counts {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.artist-count-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 0.85rem;
}

.artist-count-item .artist-name { font-weight: bold; }
.artist-count-item .artist-count { color: #fbbf24; }
.artist-count-item .artist-value { color: #4ade80; font-size: 0.8rem; }

.hand-cards {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 90px;
}

.card {
    width: 75px;
    height: 100px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}
.card:hover:not(.disabled) { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5); }
.card.disabled { opacity: 0.7; cursor: default; }
.card.selectable { cursor: pointer; }
.card.selected { border-color: #fbbf24; box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); transform: translateY(-10px); }

.card-type {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: bold;
}

.card-value { font-size: 1.4rem; font-weight: bold; }
.card-artist { font-size: 0.75rem; opacity: 0.9; }

.status-bar {
    text-align: center;
    padding: 0.4rem;
    color: #888;
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 35, 0.99));
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    min-width: 300px;
    max-width: 90vw;
    margin: 0 auto;
}

.modal-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #fbbf24;
}

.sealed-timer {
    text-align: center;
    font-size: 1.5rem;
    color: #fbbf24;
    margin-bottom: 1rem;
}

.price-input-section, .fixed-price-section, .loan-amount-section {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.price-input-section input, .fixed-price-section input, .loan-amount-section input {
    width: 150px;
    padding: 0.8rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
}

/* Round End Banner */
#round-end-banner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 1.5rem 3rem;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 50;
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.5);
    animation: bannerPop 0.5s ease-out;
}

@keyframes bannerPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Winner Screen */
#winner-screen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a1a2e, #0a0a0f);
}

.winner-title {
    font-size: 3rem;
    color: #fbbf24;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

#winner-name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

#final-score {
    font-size: 1.5rem;
    color: #4ade80;
    margin-bottom: 2rem;
}

.leaderboard {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
    padding: 1.5rem 2rem;
    border-radius: 16px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    min-width: 400px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-item .rank { font-size: 1.2rem; width: 40px; }
.leaderboard-item .name { flex: 1; font-weight: bold; }
.leaderboard-item .score { color: #4ade80; font-weight: bold; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(251, 191, 36, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(251, 191, 36, 0.5); }