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

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    background:
        radial-gradient(circle at top left, #ff4d5a, transparent 35%),
        linear-gradient(135deg, #3b070b, #9e111b);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at top right, #4d8dff, transparent 35%),
        linear-gradient(135deg, #07183b, #123f9e);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

body.player2-turn::before {
    opacity: 1;
}

#game-mode-screen,
#ai-loading {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

#game-mode-screen {
    background:
        radial-gradient(circle at 50% 0%, #343434, transparent 45%),
        linear-gradient(135deg, #101010, #050505);
}

#game-mode-screen h1,
#ai-loading h1 {
    font-size: clamp(48px, 8vw, 90px);
    font-weight: 900;
    letter-spacing: -4px;
    margin-bottom: 15px;
}

#game-mode-screen h2,
#ai-loading h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

#game-mode-screen p,
#ai-loading p {
    max-width: 600px;
    line-height: 1.6;
    color: #cfcfcf;
    margin-bottom: 25px;
}

#game-mode-screen button {
    width: min(420px, 90vw);
    padding: 18px 25px;
    margin: 8px;
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 19px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

#ai-mode-button {
    background: linear-gradient(135deg, #8b5cf6, #5b21b6);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
}

#premade-mode-button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

#game-mode-screen button:hover {
    transform: translateY(-3px);
    filter: brightness(1.12);
}

#game-mode-screen button:active {
    transform: translateY(0);
}

#ai-loading {
    background:
        radial-gradient(circle at center, #222, transparent 55%),
        #080808;
}

#ai-loading-text {
    min-height: 28px;
}

#ai-progress-container {
    width: min(600px, 85vw);
    height: 20px;
    margin-top: 10px;
    background: #222;
    border: 1px solid #444;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

#ai-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(
        90deg,
        #8b5cf6,
        #c084fc
    );
    border-radius: 999px;
    transition: width 0.3s ease;
}

#ai-percent {
    margin-top: 12px;
    font-size: 18px;
    font-weight: bold;
}

#game {
    width: min(1200px, 94vw);
    margin: 0 auto;
    padding: 35px 0 50px;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    font-size: clamp(42px, 7vw, 72px);
    font-weight: 900;
    letter-spacing: -3px;
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.35);
}

#theme {
    display: inline-block;
    margin-top: 10px;
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    font-size: 20px;
}

#auction {
    padding: 30px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

#auction h2 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.7;
    margin-bottom: 15px;
}

#current-item {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 900;
}

#auction-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

#auction-info p {
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
}

#current-bid {
    font-size: 25px;
}

#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

#bid-input {
    width: 180px;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    color: white;
    font-size: 18px;
    outline: none;
}

#bid-input:focus {
    border-color: white;
}

#bid-input::placeholder {
    color: #aaa;
}

#controls button {
    padding: 14px 25px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

#bid-button {
    background: #22c55e;
}

#pass-button {
    background: #f59e0b;
}

#controls button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

#controls button:active:not(:disabled) {
    transform: translateY(0);
}

#controls button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#auction-status {
    min-height: 25px;
    margin-top: 20px;
    color: #e5e5e5;
    font-weight: 600;
}

#players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

#player1,
#player2 {
    padding: 25px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

#player1 {
    box-shadow: inset 5px 0 0 #ff3b4d;
}

#player2 {
    box-shadow: inset 5px 0 0 #3b82f6;
}

#player1 h2,
#player2 h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

#player1 p,
#player2 p {
    margin: 7px 0;
    color: #ddd;
}

#money1,
#money2 {
    font-size: 22px;
    font-weight: 900;
}

.inventory {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 20px;
}

.item-slot {
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: #888;
    font-size: 13px;
    font-weight: 700;
}

.item-slot.filled {
    color: white;
    border-style: solid;
    background: rgba(255, 255, 255, 0.12);
}

#game-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
}

#game-stats p {
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

#new-game-button {
    display: block;
    margin: 0 auto;
    padding: 14px 30px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#new-game-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

@media (max-width: 800px) {
    #players {
        grid-template-columns: 1fr;
    }

    .inventory {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 500px) {
    #game {
        width: 92vw;
        padding-top: 20px;
    }

    #auction {
        padding: 20px;
    }

    #players {
        gap: 15px;
    }

    #player1,
    #player2 {
        padding: 18px;
    }

    .item-slot {
        min-height: 65px;
        font-size: 11px;
    }

    #bid-input {
        width: 100%;
    }

    #controls button {
        flex: 1;
    }
}
