:root {
    --bg-color: #0d0d0d;
    --card-bg: #1a1a1a;
    --primary: #00ff88;
    --secondary: #00ccff;
    --accent: #ff0055;
    --text: #ffffff;
    --text-muted: #888888;
    --font-main: 'Inter', system-ui, sans-serif;
    --glass: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    position: relative;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: transform 0.2s, opacity 0.2s;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

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

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--glass);
}

.btn-danger {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    margin: 0;
}

/* Inputs */
input {
    width: 100%;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    text-align: center;
}

input:focus {
    border-color: var(--primary);
}

/* Views */
.view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.5s ease;
}

#view-overview {
    justify-content: center;
}

#view-game {
    flex-direction: column;
    justify-content: center;
}

.view.active {
    display: flex;
}

/* Lobby List */
.player-list {
    width: 100%;
    list-style: none;
    margin-bottom: 2rem;
}

.player-item {
    background: var(--glass);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.player-item.is-me {
    border-color: var(--primary);
}

.player-item.seen {
    opacity: 0.5;
}

.player-item .status {
    font-size: 0.8rem;
    opacity: 0.7;
}

.player-item .status.host {
    color: var(--secondary);
    font-weight: bold;
    opacity: 1;
}

.player-item .status.ready {
    color: var(--primary);
    font-weight: bold;
    opacity: 1;
}

/* Card / Pull to Reveal */
.card-container {
    perspective: 1000px;
    width: 100%;
    max-width: 320px;
    height: 400px;
    /* shorter to fit drag */
    position: relative;
    margin: 2rem auto;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #222, #333);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    border-radius: 20px;
    transition: transform 0.1s linear;
    /* Smooth drag */
    cursor: grab;
    padding-bottom: 40px;
}

.card-cover.revealed {
    transform: translateY(-100%) !important;
    transition: transform 0.4s ease-out;
}

.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #111;
    /* Neutral background */
    border-radius: 20px;
    padding: 20px;
}

/* Pull Indicator */
.pull-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounce 2s infinite;
    opacity: 0.8;
}

.pull-text {
    font-size: 0.9rem;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
}

.pull-arrow {
    font-size: 2rem;
    color: var(--primary);
}

/* Role Styles */
.role-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.role-imposter {
    background: rgba(255, 0, 85, 0.2);
    color: #ff0055;
    border: 1px solid #ff0055;
}

.role-civilian {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.word-text {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    text-align: center;
    word-break: break-word;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Toast & Modals */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    border: 1px solid var(--glass);
    text-align: center;
    min-width: 200px;
}

.toast.show {
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1500;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Helper classes */
.hidden {
    display: none !important;
}