/* ════════════════════════════════════════════════════════════════
   PAPER.IO 2 - CSS PRINCIPAL
   ════════════════════════════════════════════════════════════════ */

:root {
    --bg-dark: #0f0f1a;
    --bg-panel: rgba(15, 15, 30, 0.92);
    --primary: #3a7bd5;
    --secondary: #00d2ff;
    --accent: #ffd700;
    --danger: #e74c3c;
    --success: #2ecc71;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --border: rgba(255, 255, 255, 0.12);
}

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

body {
    font-family: 'Nunito', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
    -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════════════════════════════
   ÉCRANS
   ════════════════════════════════════════════════════════════════ */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.screen.active {
    display: flex;
}

.background-animated {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(58, 123, 213, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 210, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    z-index: -1;
}

/* ════════════════════════════════════════════════════════════════
   MENU PRINCIPAL
   ════════════════════════════════════════════════════════════════ */

.menu-container {
    max-width: 420px;
    width: 90%;
    text-align: center;
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #3a7bd5 50%, #ffd700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(58, 123, 213, 0.5);
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.player-preview-container {
    margin: 1.5rem auto;
    width: 120px;
    height: 120px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#preview-canvas {
    display: block;
}

/* ════════════════════════════════════════════════════════════════
   INPUTS
   ════════════════════════════════════════════════════════════════ */

.input-group {
    margin: 1.5rem 0;
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.1);
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
}

/* ════════════════════════════════════════════════════════════════
   BOUTONS
   ════════════════════════════════════════════════════════════════ */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(58, 123, 213, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 12px 30px rgba(58, 123, 213, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--secondary);
}

.btn-accent {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.btn-large {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    width: 100%;
    margin: 1rem 0;
}

.btn-icon {
    margin-right: 0.5rem;
    font-size: 1.3em;
}

.btn-label {
    font-size: 0.9rem;
}

.btn-back {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--border);
}

.btn-link {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
    position: relative;
}

.btn-link:hover {
    color: var(--secondary);
    transform: none;
}

/* ════════════════════════════════════════════════════════════════
   MENU BUTTONS
   ════════════════════════════════════════════════════════════════ */

.menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

/* ════════════════════════════════════════════════════════════════
   COINS DISPLAY
   ════════════════════════════════════════════════════════════════ */

.coins-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
}

.coins-icon {
    font-size: 1.3em;
    font-weight: 900;
}

/* ════════════════════════════════════════════════════════════════
   NOTIFICATION DOT
   ════════════════════════════════════════════════════════════════ */

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.notification-dot.hidden {
    display: none;
}

/* ════════════════════════════════════════════════════════════════
   SÉLECTION DE RÉGION
   ════════════════════════════════════════════════════════════════ */

.region-container {
    max-width: 900px;
    width: 95%;
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

.region-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.region-header h2 {
    flex: 1;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-right: 50px;
}

.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.region-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.region-card:hover {
    transform: scale(1.05);
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.08);
}

.region-icon {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.region-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.region-players {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* ════════════════════════════════════════════════════════════════
   SKINS
   ════════════════════════════════════════════════════════════════ */

.skins-container {
    max-width: 900px;
    width: 95%;
    height: 90vh;
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.skins-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.skins-header h2 {
    flex: 1;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
}

/* ════════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════════ */

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
}

/* ════════════════════════════════════════════════════════════════
   SKINS GRID
   ════════════════════════════════════════════════════════════════ */

.skins-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 1rem;
    padding-right: 0.5rem;
}

.skin-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.skin-card:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.08);
}

.skin-card.selected {
    border-color: var(--secondary);
    background: rgba(0, 210, 255, 0.1);
}

.skin-card.locked {
    opacity: 0.6;
}

.skin-preview {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.skin-name {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.skin-price {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 800;
}

.skin-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
}

.lock-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* ════════════════════════════════════════════════════════════════
   SKIN PREVIEW BAR
   ════════════════════════════════════════════════════════════════ */

.skin-preview-bar {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#skin-preview-canvas {
    display: block;
    border-radius: 8px;
}

.preview-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-name {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 800;
}

/* ════════════════════════════════════════════════════════════════
   BOUTIQUE
   ════════════════════════════════════════════════════════════════ */

.store-container {
    max-width: 800px;
    width: 95%;
    height: 90vh;
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.store-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.store-header h2 {
    flex: 1;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
}

.store-items {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.store-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.store-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.store-item-icon {
    font-size: 3rem;
    min-width: 60px;
    text-align: center;
}

.store-item-info {
    flex: 1;
}

.store-item-name {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.store-item-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.store-item-price {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent);
}

.store-item-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--danger);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
}

.store-item.owned {
    opacity: 0.6;
}

.store-item.owned .store-item-price {
    color: var(--success);
}

/* ════════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal.hidden {
    display: none !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-content h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

/* ════════════════════════════════════════════════════════════════
   DAILY REWARD
   ════════════════════════════════════════════════════════════════ */

.daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.daily-day {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.daily-day.claimed {
    opacity: 0.5;
    border-color: var(--success);
}

.daily-day.today {
    border-color: var(--accent);
    background: rgba(255, 215, 0, 0.1);
    animation: glow 1.5s infinite;
}

.daily-day.future {
    opacity: 0.3;
}

.daily-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.daily-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.daily-coins {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent);
}

/* ════════════════════════════════════════════════════════════════
   NOTIFICATION TOAST
   ════════════════════════════════════════════════════════════════ */

.notification-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text-primary);
    font-weight: 700;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-toast.active {
    opacity: 1;
}

.notification-toast.hidden {
    display: none;
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .menu-container,
    .region-container,
    .skins-container,
    .store-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .region-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .skins-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

/* ════════════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
