:root {
    --bg-canvas: #141416;
    --bg-surface: #1e1e22;
    --bg-surface-elevated: #28282e;
    --bg-input: #232329;
    --text-primary: #f5f3ee;
    --text-muted: #b0aca2;
    --accent-primary: #eab308;
    --accent-secondary: #f59e0b;
    --accent-contrast: #141416;
    --border-subtle: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(234, 179, 8, 0.45);
    --success-bg: #16a34a;
    --danger-bg: #dc2626;
    --radius-card: 16px;
    --radius-btn: 12px;
    --radius-pill: 999px;
    --nav-height: 68px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app-shell {
    max-width: 480px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 14px 14px calc(var(--nav-height) + 24px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.app-topbar {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 2px;
}

.hero-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 18px 16px;
    text-align: center;
}

.hero-icon {
    font-size: 38px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.hero-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.hero-room-code {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.surface-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 14px;
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.btn-primary {
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: var(--radius-btn);
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--accent-contrast);
    cursor: pointer;
    touch-action: manipulation;
}

.btn-primary:active {
    transform: scale(0.99);
}

.btn-success {
    background: var(--success-bg);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-btn);
    min-height: 46px;
    padding: 10px 14px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-danger {
    background: var(--danger-bg);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-btn);
    min-height: 46px;
    padding: 10px 14px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.field-input,
.field-select {
    width: 100%;
    min-height: 46px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    padding: 10px 14px;
    font-size: 15px;
}

.field-input::placeholder {
    color: var(--text-muted);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    padding: 10px 12px;
}

.leaderboard-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.leaderboard-rank {
    font-weight: 800;
    min-width: 22px;
    text-align: center;
    color: var(--accent-primary);
}

.leaderboard-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.leaderboard-score {
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
    color: var(--accent-primary);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--nav-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 50;
}

.bottom-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
}

.bottom-nav-btn.is-active {
    color: var(--accent-primary);
}

.bottom-nav-icon {
    font-size: 18px;
    line-height: 1;
}

.badge-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-surface-elevated);
    color: var(--accent-primary);
    border: 1px solid var(--border-accent);
}
/* --- Formulář vstupu a PIN --- */
.join-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.join-subtitle {
    margin: 4px 0 16px;
    font-size: 13px;
    text-align: center;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-label.center-label,
.center-hint {
    text-align: center;
}

.input-with-hash {
    position: relative;
    display: flex;
    align-items: center;
}

.hash-prefix {
    position: absolute;
    left: 14px;
    font-weight: 800;
    color: var(--accent-primary);
    pointer-events: none;
}

.hash-input {
    padding-left: 32px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.role-selector-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    padding: 8px;
}

.role-arrow {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    touch-action: manipulation;
}

.role-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px;
    scrollbar-width: none;
}

.role-carousel::-webkit-scrollbar {
    display: none;
}

.role-item {
    flex: 0 0 76px;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.role-item.is-selected {
    opacity: 1;
    transform: scale(1.05);
}

.shirt-icon-wrap {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shirt-svg {
    width: 38px;
    height: 38px;
}

.role-caption {
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 76px;
}

.selected-role-name {
    text-align: center;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-primary);
}

.pin-inputs-wrap {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

.pin-digit {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    background: var(--bg-input);
    color: var(--accent-primary);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-btn);
}

.pin-digit:focus {
    outline: 2px solid var(--accent-primary);
    border-color: transparent;
}

.form-error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid var(--danger-bg);
    color: #fca5a5;
    padding: 10px;
    border-radius: var(--radius-btn);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

.join-btn {
    margin-top: 8px;
}