/* Mela Bingo - Modern Responsive Styles */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --secondary: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --radius: 12px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header / Nav */
.topnav, header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.user-info {
    font-size: 0.9rem;
    color: var(--muted);
}

.lang-switch a {
    color: var(--muted);
    margin: 0 4px;
    font-weight: 600;
}
.lang-switch a:hover { color: var(--primary); }

.back {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Landing */
.landing {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.demo-note {
    max-width: 420px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 28px;
    opacity: 0.85;
}

footer {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}
.btn.primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn.secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    margin-left: 10px;
}
.btn.secondary:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Auth */
.auth-box {
    max-width: 400px;
    margin: 60px auto;
    padding: 32px 28px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.auth-box h2 {
    margin-bottom: 24px;
    color: var(--primary);
}

.auth-box input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.auth-box .btn {
    width: 100%;
    margin-top: 8px;
}

.auth-box p {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.success-msg {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}

.container h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--primary);
}

/* Dashboard Menu */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.menu-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
}

.menu-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--primary);
}

.menu-card.play {
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    color: #fff;
    border: none;
}
.menu-card.play:hover {
    color: #fff;
    filter: brightness(1.1);
}

.menu-card.logout {
    color: var(--danger);
}

/* Rooms */
.rooms-list {
    display: grid;
    gap: 12px;
}

.room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    color: var(--text);
    transition: all 0.2s;
}

.room-card:hover {
    border-color: var(--primary);
    text-decoration: none;
    transform: translateX(4px);
}

.room-card .fee {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
}

.room-card .info {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Card Selection */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
    margin: 20px 0;
}

.card-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.card-btn:hover:not(.taken):not(.selected) {
    border-color: var(--primary);
}

.card-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.card-btn.taken {
    background: #334155;
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.selection-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    padding: 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.selection-bar .info {
    flex: 1;
    font-size: 0.95rem;
}

/* Bingo Card Display */
.bingo-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin: 20px 0;
}

.bingo-card {
    background: #fff;
    color: #0f172a;
    border-radius: 10px;
    padding: 10px;
    width: 220px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.bingo-card .header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--primary-dark);
}

.bingo-card .header span:nth-child(1) { color: #dc2626; }
.bingo-card .header span:nth-child(2) { color: #ea580c; }
.bingo-card .header span:nth-child(3) { color: #16a34a; }
.bingo-card .header span:nth-child(4) { color: #2563eb; }
.bingo-card .header span:nth-child(5) { color: #7c3aed; }

.bingo-card .grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.bingo-card .cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
}

.bingo-card .cell.marked {
    background: var(--primary);
    color: #fff;
}

.bingo-card .cell.free {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
}

/* Game Screen */
.game-header {
    text-align: center;
    margin-bottom: 16px;
}

.game-header .pool {
    font-size: 1.3rem;
    color: var(--secondary);
    font-weight: 700;
}

.called-display {
    text-align: center;
    margin: 16px 0;
}

.called-display .last {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}

.called-display .count {
    color: var(--muted);
    font-size: 0.9rem;
}

.number-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    max-width: 500px;
    margin: 0 auto 20px;
}

.number-board span {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--muted);
}

.number-board span.called {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.game-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Forms */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 420px;
    margin: 0 auto;
}

.form-card label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.form-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.form-card .note {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 16px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; }
    .bingo-card { width: 180px; }
    .number-board { grid-template-columns: repeat(8, 1fr); }
    .menu-grid { grid-template-columns: repeat(2, 1fr); }
}
