* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: "Luckiest Guy";
    src: url("public/assets/font/LuckiestGuy.ttf") format("truetype");
}

body {
    background-color: #000c18;
    color: #ffffff;
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

#phaser-game {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.25);
}

/* ========================================================
   MODAL & OVERLAY SYSTEM
======================================================== */
.hidden {
    display: none !important;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 12, 28, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeInOverlay 0.25s ease-out;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: linear-gradient(135deg, rgba(8, 28, 52, 0.95), rgba(4, 18, 36, 0.98));
    border: 2px solid rgba(0, 229, 255, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 229, 255, 0.25);
    border-radius: 24px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popInModal 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-wide {
    max-width: 900px !important;
}

@keyframes popInModal {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 28px 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    position: relative;
}

.modal-title {
    font-family: 'Luckiest Guy', cursive;
    font-size: 28px;
    color: #00E5FF;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
    letter-spacing: 1px;
}

.modal-subtitle {
    font-size: 14px;
    color: #b0d8ff;
    margin-top: 4px;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 28px;
    line-height: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #ff3366;
    border-color: #ff3366;
    transform: rotate(90deg);
}

/* Prize Showcase Banner */
.prize-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(90deg, rgba(255, 187, 0, 0.15), rgba(0, 229, 255, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 18px;
    margin: 16px 24px 10px;
    padding: 12px 18px;
}

.prize-watch-img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    animation: pulseWatch 2s infinite ease-in-out;
}

@keyframes pulseWatch {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.prize-info h4 {
    font-size: 18px;
    color: #FFD700;
    margin: 2px 0;
    font-weight: 700;
}

.prize-info p {
    font-size: 13px;
    color: #e0f0ff;
}

.prize-tag {
    background: #FFD700;
    color: #000000;
    font-weight: 800;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* Leaderboard Table */
.leaderboard-date-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 26px;
    font-size: 13px;
    color: #7dc4ff;
}

.leaderboard-table-container {
    padding: 0 24px;
    overflow-y: auto;
    max-height: 380px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.leaderboard-table th {
    text-align: left;
    font-size: 12px;
    color: #60a5fa;
    padding: 6px 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.leaderboard-table td {
    padding: 10px 14px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.04);
}

.leaderboard-table tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.leaderboard-table tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.leaderboard-table tr.rank-1 td {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.25), rgba(255, 170, 0, 0.15));
    border-top: 1px solid rgba(255, 215, 0, 0.5);
    border-bottom: 1px solid rgba(255, 215, 0, 0.5);
    color: #FFF275;
    font-weight: 700;
}

.leaderboard-table tr.rank-2 td {
    background: rgba(220, 220, 230, 0.12);
    color: #E2E8F0;
    font-weight: 600;
}

.leaderboard-table tr.rank-3 td {
    background: rgba(205, 127, 50, 0.12);
    color: #FBD38D;
    font-weight: 600;
}

.badge-watch {
    background: #FFD700;
    color: #000;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 800;
    margin-left: 6px;
}

.badge-disc {
    background: rgba(0, 229, 255, 0.2);
    color: #00E5FF;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 600;
}

/* Rules Modal */
.rules-scrollable {
    padding: 20px 28px;
    overflow-y: auto;
    max-height: 60vh;
}

.rule-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rule-head {
    color: #00E5FF;
    font-size: 17px;
    margin-bottom: 10px;
    font-weight: 700;
}

.rule-list {
    padding-left: 20px;
    line-height: 1.6;
    font-size: 14px;
    color: #d8ecff;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 500px) {
    .items-grid { grid-template-columns: 1fr; }
}

.item-card {
    background: rgba(0, 15, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.item-card img {
    height: 65px;
    object-fit: contain;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.item-card .item-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
}

.item-card .item-pts {
    font-family: 'Luckiest Guy', cursive;
    font-size: 24px;
    color: #00FF66;
}

.item-card .item-pts.minus {
    color: #FF3344;
}

.item-card .item-desc {
    font-size: 11px;
    color: #94A3B8;
}

.special-combo {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.15), rgba(0, 229, 255, 0.15));
    border-color: #FFD700;
}

.special-combo p {
    font-size: 14px;
    color: #FFF275;
}

.fever-highlight {
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.2), rgba(255, 170, 0, 0.15));
    border-color: #FF0055;
}

.fever-highlight p {
    font-size: 14px;
    color: #FFCCD5;
}

.discount-tiers-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tier-badge {
    flex: 1;
    min-width: 140px;
    background: rgba(0, 30, 60, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tier-score { font-size: 12px; color: #94A3B8; }
.tier-discount { font-size: 18px; font-weight: 800; color: #00E5FF; }
.tier-code { font-size: 11px; background: rgba(0, 229, 255, 0.15); padding: 2px; border-radius: 6px; color: #E2E8F0; }

/* Modal Footer */
.modal-footer {
    padding: 16px 28px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Modern Buttons */
.btn {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 22px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.btn-primary {
    background: linear-gradient(135deg, #00E5FF, #0077FE);
    color: #000a18;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4);
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================================================
   PLAYER NAME INPUT OVERLAY
======================================================== */
.game-player-input {
    position: absolute;
    z-index: 100;
    box-sizing: border-box;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    color: #00FFFF;
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    text-align: center;
    caret-color: #00FFFF;
    display: none;
    padding: 0 10px;
    margin: 0;
}

.game-player-input::placeholder {
    color: #64748B;
    opacity: 0.85;
    font-weight: 500;
}

.game-player-input:focus {
    outline: none;
}


.ic {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.18em;
    flex-shrink: 0;
}
