/**
 * TruffaMarket v2 - Premium Styles
 * Vibrant dark theme with neon glow effects
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0d0d1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --text: #ffffff;
    --text-muted: #8888aa;
    --primary: #00ff88;
    --primary-glow: rgba(0, 255, 136, 0.4);
    --secondary: #ff6b9d;
    --accent: #ffd93d;
    --accent-glow: rgba(255, 217, 61, 0.4);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.4);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #00cc6a 100%);
    color: var(--bg-dark);
    box-shadow: 0 8px 32px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px var(--primary-glow);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--purple) 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 8px 32px var(--purple-glow);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px var(--purple-glow);
}

.btn-large {
    width: 100%;
    padding: 20px;
    font-size: 20px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== LANDING PAGE ===== */
.landing-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: radial-gradient(ellipse at top, #1a1a3e 0%, var(--bg-dark) 70%);
    position: relative;
}

.landing-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.landing-screen h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px var(--primary-glow);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px var(--primary-glow));
    }

    to {
        filter: drop-shadow(0 0 40px var(--accent-glow));
    }
}

.landing-screen .subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 50px;
}

.landing-form {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.landing-form input {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid #333;
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 18px;
    font-family: inherit;
    text-align: center;
    transition: all 0.3s;
}

.landing-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.landing-form input::placeholder {
    color: var(--text-muted);
}

.or-divider {
    color: var(--text-muted);
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #444, transparent);
}

/* ===== TV SCREEN ===== */
.tv-screen {
    background: radial-gradient(ellipse at center, #1a1a3e 0%, var(--bg-dark) 70%);
    min-height: 100vh;
}

.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.room-code {
    font-size: 20px;
    color: var(--text-muted);
}

.room-code span {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 3px;
}

.game-info {
    display: flex;
    gap: 20px;
    font-size: 18px;
    align-items: center;
}

.game-info span:last-child {
    background: linear-gradient(135deg, var(--primary), #00cc6a);
    color: var(--bg-dark);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
}

.tv-main {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.tv-view h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Big room code display */
.big-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 15px;
    margin: 20px 0;
    text-shadow: 0 0 60px var(--accent-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        text-shadow: 0 0 40px var(--accent-glow);
    }

    50% {
        text-shadow: 0 0 80px var(--accent-glow), 0 0 120px var(--accent-glow);
    }
}

/* QR Code container */
.qr-container {
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.qr-container img {
    width: 180px;
    height: 180px;
}

.join-url {
    font-size: 1.2rem;
    color: var(--primary);
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    font-family: monospace;
}

/* Players grid */
.players-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    max-width: 900px;
}

.player-slot {
    width: 140px;
    height: 140px;
    background: var(--bg-card);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px dashed #333;
    transition: all 0.3s;
}

.player-slot.filled {
    border: 3px solid var(--primary);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
    box-shadow: 0 10px 40px var(--primary-glow);
    animation: playerJoin 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes playerJoin {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.player-slot .avatar {
    font-size: 3rem;
    margin-bottom: 10px;
}

.player-slot .name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.player-count {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 20px 0;
}

.progress-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 30px 0;
}

/* Presentation card */
.presentation-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #252545 100%);
    border: 4px solid var(--accent);
    border-radius: 30px;
    padding: 60px;
    margin: 40px 0;
    max-width: 800px;
    box-shadow: 0 30px 80px rgba(255, 217, 61, 0.2);
    position: relative;
    overflow: hidden;
}

.presentation-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--accent-glow), transparent);
    animation: rotate 4s linear infinite;
    opacity: 0.3;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

.presentation-card>* {
    position: relative;
    z-index: 1;
}

.item-emoji-large {
    font-size: 8rem;
    margin-bottom: 20px;
}

.item-original {
    color: var(--text-muted);
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.item-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 25px;
}

.item-story {
    font-size: 1.6rem;
    font-style: italic;
    color: var(--text);
    margin-bottom: 30px;
    line-height: 1.6;
}

.item-seller {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 600;
}

/* Results */
.results-list,
.standings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
    width: 100%;
    max-width: 700px;
}

.result-item,
.standing-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.result-item:hover,
.standing-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(5px);
}

.result-item.winner,
.standing-item.winner {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.1), rgba(255, 217, 61, 0.05));
    box-shadow: 0 10px 40px var(--accent-glow);
}

.medal {
    font-size: 2rem;
    width: 50px;
}

.position {
    font-size: 1.3rem;
    width: 50px;
    color: var(--text-muted);
    font-weight: 600;
}

.result-item .name,
.standing-item .name {
    flex: 1;
    text-align: left;
    font-weight: 700;
    font-size: 1.2rem;
}

.result-item .title {
    color: var(--text-muted);
    font-style: italic;
}

.stars,
.value,
.points {
    font-weight: 700;
    font-size: 1.2rem;
}

/* ===== PLAYER SCREEN ===== */
.player-screen {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0d0d2a 100%);
    min-height: 100vh;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-name {
    font-weight: 700;
    font-size: 18px;
}

.player-points {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
}

.player-main {
    padding: 25px 20px;
    min-height: calc(100vh - 60px);
}

.player-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-view h2 {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.waiting-content {
    text-align: center;
    padding: 80px 20px;
}

.waiting-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.waiting-content p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.big-emoji {
    font-size: 6rem;
    margin-top: 40px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Shop */
.shop-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    background: var(--bg-card);
    border: 3px solid #333;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-item:hover {
    border-color: var(--purple);
    background: var(--bg-card-hover);
}

.shop-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
    box-shadow: 0 10px 40px var(--primary-glow);
    transform: scale(1.02);
}

.shop-item .item-emoji {
    font-size: 3rem;
}

.shop-item .item-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.shop-item .item-price {
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 800;
}

/* Write form */
.your-item {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--bg-card), #252545);
    border-radius: 20px;
    border: 2px solid var(--purple);
    margin-bottom: 15px;
}

.your-item span:first-child {
    font-size: 4rem;
    display: block;
    margin-bottom: 12px;
}

.your-item span:last-child {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 18px;
    border: 2px solid #333;
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 17px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-glow);
}

.char-count {
    display: block;
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Vote */
.vote-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vote-item {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    border: 2px solid #333;
    transition: all 0.3s;
}

.vote-item:hover {
    border-color: var(--purple);
}

.vote-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vote-item-header span:first-child {
    font-weight: 700;
    font-size: 1.2rem;
}

.seller {
    color: var(--text-muted);
    font-size: 14px;
}

.vote-story {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 18px;
    line-height: 1.5;
    font-size: 15px;
}

.star-rating {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.star {
    font-size: 2.5rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.star:hover {
    transform: scale(1.3);
    color: var(--accent);
}

.star.active {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--primary), #00cc6a);
    color: var(--bg-dark);
    padding: 18px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 10px 40px var(--primary-glow);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .landing-screen h1 {
        font-size: 2.5rem;
    }

    .tv-view h1 {
        font-size: 2rem;
    }

    .big-code {
        font-size: 3.5rem;
        letter-spacing: 8px;
    }

    .presentation-card {
        padding: 30px;
    }

    .item-emoji-large {
        font-size: 5rem;
    }

    .item-title {
        font-size: 2rem;
    }

    .item-story {
        font-size: 1.2rem;
    }

    .player-slot {
        width: 100px;
        height: 100px;
    }

    .player-slot .avatar {
        font-size: 2rem;
    }
}