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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #0b0b0e;
    color: #e2e8f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(circle, #1a1a24 0%, #0b0b0e 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.keller-header {
    text-align: center;
    margin-bottom: 30px;
}

.keller-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffb703;
    text-shadow: 0 0 10px rgba(255, 183, 3, 0.4);
    letter-spacing: 2px;
}

.keller-header .subtitle {
    font-size: 13px;
    color: #8a8f98;
    margin-top: 5px;
}

.auth-box {
    background-color: #14141c;
    border: 1px solid #242432;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.auth-box h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 1px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: #a0aec0;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    background-color: #1f1f2e;
    border: 1px solid #2d2d44;
    border-radius: 6px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #ffb703;
    background-color: #252538;
    box-shadow: 0 0 8px rgba(255, 183, 3, 0.2);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    border: none;
    border-radius: 6px;
    color: #000000;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 133, 0, 0.4);
}

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

.switch-text {
    text-align: center;
    font-size: 13px;
    color: #a0aec0;
    margin-top: 20px;
}

.switch-text a {
    color: #ffb703;
    text-decoration: none;
    font-weight: 700;
}

.switch-text a:hover {
    text-decoration: underline;
}

.error-msg {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.success-msg {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.lobby-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #14141c;
    border-bottom: 1px solid #242432;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 30px;
    z-index: 100;
}

.logo-area h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    color: #ffffff;
    letter-spacing: 1px;
}

.logo-area h1 span {
    color: #ffb703;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: end;
}

.user-profile .username {
    font-weight: 700;
    color: #ffffff;
}

.badge {
    background-color: #fb8500;
    color: #000000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.balance-box {
    background-color: #1f1f2e;
    border: 1px solid #2d2d44;
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ffb703;
}

.btn-logout {
    background-color: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: #ffffff;
}

.lobby-grid {
    position: absolute;
    top: 90px;
    left: 0;
    width: 100%;
    height: calc(100vh - 115px);
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: 
        "games leaderboard"
        "games chat";
    gap: 20px;
    padding: 0 20px;
}

.grid-box {
    background-color: #14141c;
    border: 1px solid #242432;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.grid-box.lobby-games-box { grid-area: games; }
.grid-box.lobby-leaderboard-box { grid-area: leaderboard; }
.grid-box.lobby-chat-box { grid-area: chat; }

.grid-box h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid #242432;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-tiles-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    overflow-y: auto;
    height: 100%;
    padding-right: 4px;
}

.game-tile-card {
    background-color: #1f1f2e;
    border: 1px solid #2d2d44;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    width: 100%;
    aspect-ratio: 1.4 / 1;
}

.game-tile-card:hover {
    border-color: #ffb703;
    background-color: #252538;
    transform: translateY(-2px);
}

.game-tile-card .game-icon {
    font-size: 36px;
}

.game-tile-card .game-info h3 {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 2px;
}

.game-tile-card .game-info p {
    color: #8a8f98;
    font-size: 12px;
}

.game-tile-card.extension {
    border-style: dashed;
}

.table-wrapper {
    overflow-y: auto;
    flex-grow: 1;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #1f1f2e;
}

.leaderboard-table th {
    color: #a0aec0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-table tbody tr:hover {
    background-color: #1f1f2e;
}

.loading {
    text-align: center;
    color: #8a8f98;
    padding: 20px 0;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    background-color: #0b0b0e;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    border: 1px solid #1f1f2e;
}

.chat-msg {
    font-size: 13px;
    line-height: 1.4;
}

.chat-msg .sender {
    font-weight: 700;
    color: #ffb703;
    margin-right: 5px;
}

.system-msg {
    font-size: 12px;
    color: #fb8500;
    font-style: italic;
    background-color: rgba(251, 133, 0, 0.05);
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid #fb8500;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex-grow: 1;
    background-color: #1f1f2e;
    border: 1px solid #2d2d44;
    border-radius: 6px;
    padding: 12px;
    color: #ffffff;
}

.chat-input-area button {
    background-color: #ffb703;
    border: none;
    color: #000000;
    padding: 0 20px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.btn-sound-init {
    background-color: #0b0b0e;
    border: 1px dashed #8a8f98;
    color: #8a8f98;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.btn-sound-init:hover {
    border-color: #ffb703;
    color: #ffb703;
}

.global-live-ticker-box {
    background-color: #0b0b0e;
    border: 1px dashed #ffb703;
    padding: 8px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 380px;
    overflow: hidden;
    height: 36px;
    box-shadow: inset 0 0 10px rgba(255, 183, 3, 0.1);
}
.ticker-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    flex-shrink: 0;
}
.ticker-text-scroll {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: #ffb703;
    white-space: nowrap;
    animation: marqueeGlow 15s linear infinite;
}
@keyframes marqueeGlow {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
