body {
    font-family: Arial;
    background:
        radial-gradient(circle at top, rgba(45, 125, 255, 0.18), transparent 35%),
        radial-gradient(circle at bottom right, rgba(255, 59, 59, 0.15), transparent 28%),
        linear-gradient(180deg, #121212 0%, #1e1e1e 100%);
    color: white;
    padding: 24px;
}

h1, h2, h3 {
    letter-spacing: 0.02em;
}

#menu {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px;
    margin: 16px 0 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
}

#menu input {
    height: 42px;
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    color: white;
    padding: 0 12px;
    outline: none;
}

#menu input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

#menu button {
    height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2d7dff 0%, #1358d4 100%);
    color: white;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 20px rgba(19, 88, 212, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

#menu button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(19, 88, 212, 0.28);
    filter: brightness(1.06);
}

#menu button:active {
    transform: translateY(1px) scale(0.99);
}

#menu button:nth-of-type(1) {
    background: linear-gradient(135deg, #2ecc71 0%, #1f9f57 100%);
}

#menu button:nth-of-type(3) {
    background: linear-gradient(135deg, #ff8a3d 0%, #dd5a00 100%);
}

#menu button:nth-of-type(4) {
    background: linear-gradient(135deg, #f1c40f 0%, #b88900 100%);
    color: #111;
}

#menu button:nth-of-type(5) {
    background: linear-gradient(135deg, #ff3b3b 0%, #b30000 100%);
}

#hand {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.card {
    width: 80px;
    height: 120px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: white;
    position: relative;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.15s, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.card.pop {
    transform: scale(1);
}

.card.pop:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.card-value {
    position: relative;
    z-index: 1;
}

.card.reverse .card-value,
.card.skip .card-value {
    display: none;
}

.red {
    background: linear-gradient(135deg, #ff6464 0%, #d60000 55%, #9d0000 100%);
}

.blue {
    background: linear-gradient(135deg, #6aa5ff 0%, #1358d4 55%, #0c2f82 100%);
}

.green {
    background: linear-gradient(135deg, #79e08f 0%, #1f9f57 55%, #0f6b38 100%);
}

.yellow {
    background: linear-gradient(135deg, #ffe780 0%, #e0ad00 55%, #9a7100 100%);
}

#topCard .card {
    cursor: default;
    position: relative;
    overflow: hidden;
    transform: none;
    box-shadow: none;
    width: 100px;
    height: 140px;
    font-size: 28px;
    margin-top: 8px;
}

#topCard .card.required-color {
    border: 3px solid var(--required-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15), 0 0 18px var(--required-color);
}

#topCard .card.required-color::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--required-color);
    box-shadow: 0 0 12px var(--required-color);
}

.card-symbol {
    position: absolute;
    inset: 0;
    opacity: 0.95;
    z-index: 0;
}

.card-symbol--reverse::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.card-symbol--reverse::before {
    content: "↺";
    font-size: 68px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.card-symbol--skip::before {
    content: "⊘";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 66px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.card-symbol--wild::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 14px;
    background: conic-gradient(#ff3b3b 0 25%, #2d7dff 25% 50%, #2ecc71 50% 75%, #f1c40f 75% 100%);
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
}

.player {
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 12px;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.player.active {
    opacity: 1;
    background: rgba(46, 204, 113, 0.18);
    border-color: rgba(46, 204, 113, 0.4);
    border-left: 4px solid #2ecc71;
    transform: translateX(4px);
}

.color-picker {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.95);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    gap: 15px;
    z-index: 999;
}

.color-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.color-btn.red { background: #ff3b3b; }
.color-btn.blue { background: #2d7dff; }
.color-btn.green { background: #2ecc71; }
.color-btn.yellow { background: #f1c40f; }

.color-btn:active {
    transform: scale(0.95);
}

.card.wild {
    background: linear-gradient(135deg, #111111 0%, #2a2a2a 45%, #000000 100%);
    border: 2px solid rgba(255, 255, 255, 0.22);
    color: white;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.card.plus4 {
    background: linear-gradient(135deg, #ff00cc, #3333ff, #00ffcc);
    background-size: 300% 300%;
    animation: gradientMove 4s ease infinite;
    border: 2px solid rgba(255, 255, 255, 0.22);
    color: white;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0,0,0,0.6);
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#colorPicker {
    backdrop-filter: blur(5px);
}

.winner-banner {
    margin: 12px 0 18px;
    padding: 14px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.24), rgba(45, 125, 255, 0.24));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
}

.winner-banner.visible {
    animation: winnerPulse 0.35s ease both;
}

@keyframes winnerPulse {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}