@import url('https://font-cdn.com/css?family=Pricedown:400');

:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #FFDE00;
    --gem-color: #00e5ff;   
    --text-color: #ffffff;
    --bg-color: #1a1a2e;
    --dark-bg: #16213e;
    --header-bg: #261497;
    --correct-color: #4CAF50;
    --wrong-color: #F44336;
    --duel-color: #ff5722;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-container {
    width: 100%;
    max-width: 450px;
    height: 100dvh;
    background-color: var(--bg-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#main-content { flex-grow: 1; overflow-y: auto; position: relative; }
.screen { display: none; flex-direction: column; height: 100%; animation: fadeIn 0.5s ease; }
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.screen-header {
    background-color: var(--header-bg);
    padding: 10px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    min-height: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.screen-header h1 {
    font-family: 'Pricedown', sans-serif;
    margin: 0;
    font-size: 28px;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1;
}
.screen-content { padding: 20px; }

.coin-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 1.5px solid #000;
    vertical-align: middle;
    margin-bottom: 0.1em;
}

#bottom-nav { display: flex; background-color: var(--header-bg); border-top: 1px solid var(--primary-color); flex-shrink: 0; align-items: center; }
.nav-btn { flex-grow: 1; flex-basis: 0; padding: 20px 5px; background: none; border: none; color: #a0a0a0; cursor: pointer; font-size: 14px; transition: all 0.3s ease; border-top: 3px solid transparent; font-weight: bold; }
.nav-btn.active { color: var(--accent-color); border-top-color: var(--accent-color); }
#footer-resources { display: flex; gap: 8px; padding: 0 10px; }
.footer-resource-item { display: flex; align-items: center; gap: 4px; }
.footer-resource-icon { font-size: 14px; }
.footer-resource-display { font-size: 11px; font-weight: bold; color: white; }
#game-screen.active ~ #bottom-nav { display: none; }

.tournament-card { padding: 20px; margin-bottom: 15px; border-radius: 10px; cursor: pointer; transition: transform 0.2s ease; font-weight: bold; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.tournament-card:hover { transform: scale(1.02); }
.tournament-special-ongoing { background: linear-gradient(45deg, #ff8a00, #e52e71); }
.tournament-daily { background-color: #0d3c5f; }
.tournament-weekly { background-color: #4c1d59; }
.tournament-sponsored { background-color: #610e0e; }
.tournament-special { background-color: #6c134e; }
.tournament-freeroll { background-color: #004d40; }
.tournament-card h3 { margin-bottom: 8px; }
.tournament-card p { margin-bottom: 12px; color: #ccc; font-size: 14px; }
.tournament-footer { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 15px; }
.tournament-buttons { display: flex; gap: 10px; margin-top: 20px; }
.tournament-buttons .btn { padding: 8px 16px; font-size: 13px; border: 1px solid; }
.tournament-buttons .btn-primary { background-color: var(--header-bg); color: var(--accent-color); border-color: var(--accent-color); }
.tournament-buttons .btn-duel { background-color: var(--header-bg); color: var(--duel-color); border-color: var(--duel-color); }

.game-screen-layout { justify-content: space-between; padding: 15px; background-image: linear-gradient(to bottom, var(--primary-color), #0f0c29); }
#game-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; color: #ddd; font-weight: bold; }
#question-counter { text-align: left; }
#player-count { text-align: right; }
#leave-tournament-btn { padding: 6px 12px; font-size: 12px; }
#question-area { text-align: center; }
#question-area h2 { font-size: 22px; margin-bottom: 5px; }
#question-area #sub-prompt { color: var(--accent-color); font-size: 18px; font-weight: bold; min-height: 50px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
#status-update-area { text-align: center; font-weight: bold; color: var(--text-color); background: rgba(0,0,0,0.3); padding: 5px; border-radius: 5px; min-height: 28px; margin: 5px 0; visibility: hidden; }
#timer-circle { width: 90px; height: 90px; border-radius: 50%; background: var(--dark-bg); display: flex; justify-content: center; align-items: center; margin: 0 auto; border: 5px solid var(--accent-color); box-shadow: 0 0 20px var(--accent-color); }
#timer-text { font-size: 42px; font-weight: bold; }
#answer-options { display: grid; grid-template-columns: 1fr; gap: 12px; width: 100%; }
.answer-btn { padding: 18px; font-size: 16px; background-image: linear-gradient(to right, var(--secondary-color), var(--primary-color)); color: var(--text-color); border: 2px solid transparent; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; position: relative; }
.answer-voter-count { position: absolute; top: 5px; right: 10px; font-size: 12px; font-weight: bold; background-color: rgba(0,0,0,0.4); padding: 2px 5px; border-radius: 5px; }
.answer-btn.selected { border-color: var(--accent-color); box-shadow: 0 0 15px var(--accent-color); }
.answer-btn.correct { background: var(--correct-color); border-color: var(--text-color); transform: scale(1.05); }
.answer-btn.incorrect { filter: grayscale(80%); opacity: 0.6; }
.answer-btn.disabled { pointer-events: none; }

#shop-tabs { display: flex; padding: 0 20px; background: var(--dark-bg); }
.shop-tab-btn { flex: 1; padding: 15px; background: none; border: none; color: #a0a0a0; font-size: 14px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: bold; }
.shop-tab-btn.active { color: var(--accent-color); border-bottom-color: var(--accent-color); }
.shop-content { padding-top: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; padding-top: 20px; }
.grid-item, .mission-item { transition: transform 0.2s ease; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.grid-item:hover, .mission-item:hover { transform: scale(1.05); }
.grid-item { padding: 15px; border-radius: 10px; text-align: center; }
.grid-item.color-1 { background-color: #0d3c5f; } .grid-item.color-2 { background-color: #4c1d59; } .grid-item.color-3 { background-color: #004d40; } .grid-item.color-4 { background-color: #4a3a00; } .grid-item.color-5 { background-color: #610e0e; }
.grid-item .icon { font-size: 48px; margin-bottom: 10px; }
.grid-item h4 { margin-bottom: 5px; font-size: 14px; }

.mission-item { display: flex; align-items: center; padding: 15px; border-radius: 10px; margin-bottom: 10px; }
.mission-item.color-1 { background-color: #0d3c5f; } .mission-item.color-2 { background-color: #4c1d59; } .mission-item.color-3 { background-color: #004d40; } .mission-item.color-4 { background-color: #6c134e; } .mission-item.color-5 { background-color: #4a3a00; } .mission-item.color-6 { background-color: #610e0e; }
.mission-item .icon { font-size: 32px; margin-right: 15px; }
.mission-item p { flex-grow: 1; }
.mission-item.claimed { opacity: 0.6; }
/* NEW MISSION BUTTON COLOR */
.mission-item .btn-primary {
    background-color: var(--header-bg);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}


#profile-screen .screen-content { background: radial-gradient(circle, var(--primary-color) 0%, var(--bg-color) 70%); }
#profile-header .avatar-large { animation: glow 2.5s infinite alternate; }
#profile-level { animation: pulse 2s infinite; }
#profile-header { text-align: center; margin-bottom: 20px; }
.avatar-large { width: 100px; height: 100px; border-radius: 50%; border: 4px solid var(--accent-color); margin-bottom: 10px; background-color: var(--secondary-color); }
#profile-level { background: var(--dark-bg); padding: 5px 15px; border-radius: 20px; display: inline-block; margin-top: 10px; }
.profile-section { margin-bottom: 25px; }
.profile-section h2 { color: var(--accent-color); border-bottom: 1px solid var(--secondary-color); padding-bottom: 5px; margin-bottom: 15px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; text-align: center; }
.stat-item { padding: 15px; border-radius: 10px; border: 2px solid; font-weight: bold; }
.stat-item:nth-child(1) { background-color: #0d3c5f; border-color: #2196f3; }
.stat-item:nth-child(2) { background-color: #4c1d59; border-color: #9c27b0; }
.stat-item:nth-child(3) { background-color: #4a3a00; border-color: #ffc107; }
.stat-item:nth-child(4) { background-color: #004d40; border-color: #009688; }
.stat-item .icon { font-size: 24px; color: var(--secondary-color); }
.stat-item .value { font-size: 20px; font-weight: bold; }
.stat-item .label { font-size: 12px; color: #ccc; }
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 15px; }
.collection-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.collection-grid .achievement-badge { font-size: 96px; animation: float 3s ease-in-out infinite; }
.achievement-badge { font-size: 48px; text-align: center; background: var(--dark-bg); padding: 10px; border-radius: 50%; line-height: 1; }

.overlay, .overlay-transparent { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: none; justify-content: center; align-items: center; z-index: 1000; }
.overlay { background: rgba(0,0,0,0.9); }
.overlay-content { background: var(--dark-bg); padding: 30px; border-radius: 15px; width: 90%; text-align: center; animation: zoomIn 0.3s ease; }
#welcome-overlay .overlay-content { background: radial-gradient(circle, #e52e71, #ff8a00); }
#presenter-icon { font-size: 80px; margin-bottom: 20px; animation: bounceIn 1s; }
ul { list-style: none; padding: 0; margin-top: 15px; margin-bottom: 25px; }
li { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #444; }
li.player-highlight { background-color: var(--primary-color); font-weight: bold; border-radius: 5px; }
li.opponent-highlight { background-color: var(--duel-color); font-weight: bold; border-radius: 5px; }
.overlay-transparent { pointer-events: none; }
.coin-claim-animation { color: var(--accent-color); font-size: 24px; font-weight: bold; background: rgba(0,0,0,0.7); padding: 15px 25px; border-radius: 20px; display: none; }
@keyframes zoomIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bounceIn { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-30px);} 60% {transform: translateY(-15px);} }
@keyframes fly-to-corner { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(-150px, -300px) scale(0); opacity: 0; } }
.coin-claim-animation.animate { display: block; animation: fly-to-corner 1s ease-in-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow { from { box-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color); } to { box-shadow: 0 0 20px var(--gem-color), 0 0 30px var(--gem-color); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }

.matchmaking-container { display: flex; justify-content: space-around; align-items: center; margin: 20px 0; }
.player-card { text-align: center; }
.vs-text { font-size: 40px; font-weight: bold; color: var(--accent-color); }
.spinner { width: 50px; height: 50px; border: 5px solid #fff; border-top: 5px solid var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto 0; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.btn { padding: 10px 20px; border-radius: 20px; border: none; cursor: pointer; font-weight: bold; transition: transform 0.2s ease; font-size: 14px; }
.btn:hover { transform: scale(1.05); }
.btn-primary { background-color: var(--accent-color); color: #000; }
.btn-secondary { background-color: var(--secondary-color); color: var(--text-color); }
.btn-danger { background-color: var(--wrong-color); color: var(--text-color); }
.btn-claimed { background-color: #555; color: #aaa; cursor: default; }