* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #14161c;
    color: #f2f2f2;
    padding-bottom: 110px;
}

/* --- Login --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: #1e2129;
    border-radius: 16px;
    padding: 28px 24px;
}

.login-card h1 {
    text-align: center;
    margin-top: 0;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-card label {
    font-size: 14px;
    color: #aaa;
    margin-top: 10px;
}

.login-card select,
.login-card input {
    padding: 14px;
    font-size: 18px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #0f1116;
    color: #fff;
}

.login-card button {
    margin-top: 20px;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: #ffb703;
    color: #1a1a1a;
}

.error {
    background: #3a1a1a;
    color: #ff8a8a;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* --- Topbar --- */
.topbar {
    background: #1e2129;
    padding: 14px 18px;
}

.topbar-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.greeting {
    font-size: 15px;
}

.page-title {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    margin-right: 76px; /* gleicht die Breite des Zurück-Buttons aus -> Titel bleibt mittig */
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Echte Pill-Buttons statt reiner Text-Links */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: #ffb703;
    color: #1a1a1a;
}

.btn-muted {
    background: #2a2e38;
    color: #ddd;
    border-color: #383c46;
}

/* --- Analyse-Seite --- */
.range-label {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin: 4px 0 16px;
}

.podium-section {
    margin-bottom: 20px;
}

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
}

.podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1e2129;
    border-radius: 12px 12px 0 0;
    padding: 14px 8px;
    width: 100%;
    box-sizing: border-box;
}

.podium-medal {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 6px;
}

.podium-card .medal-emoji {
    font-size: 40px;
    width: auto;
    margin-bottom: 6px;
}

.podium-name {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.podium-count {
    font-size: 18px;
    font-weight: 700;
    color: #ffb703;
    margin-top: 4px;
}

.podium-step {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    box-sizing: border-box;
}

.step-gold {
    height: 74px;
    background: linear-gradient(180deg, #ffd23f, #ffb703);
}

.step-silver {
    height: 52px;
    background: linear-gradient(180deg, #d8dce3, #adb3bf);
}

.step-bronze {
    height: 38px;
    background: linear-gradient(180deg, #e0995e, #c97a3f);
}

.analyse-card {
    background: #1e2129;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}

.analyse-card h2 {
    font-size: 15px;
    color: #ccc;
    margin: 0 0 12px;
}

.drink-leaders {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #14161c;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
}

.leader-drink {
    color: #999;
}

.leader-info strong {
    color: #ffb703;
}

.total-count {
    text-align: center;
    color: #777;
    font-size: 13px;
    margin: 10px 0 30px;
}

/* --- Main --- */
main {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

.filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #333;
    background: #1e2129;
    color: #ccc;
    font-size: 14px;
    white-space: nowrap;
}

.filter-btn.active {
    background: #ffb703;
    color: #1a1a1a;
    border-color: #ffb703;
    font-weight: 600;
}

.ranking {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.rank-row {
    display: flex;
    align-items: center;
    background: #1e2129;
    border-radius: 12px;
    padding: 12px 14px;
    gap: 12px;
}

.rank-pos {
    width: 26px;
    text-align: center;
    font-weight: 700;
    color: #ffb703;
}

.medal-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.medal-emoji {
    font-size: 26px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.rank-name {
    flex: 1;
    font-weight: 600;
}

.rank-detail {
    font-size: 12px;
    color: #999;
}

.rank-total {
    font-size: 20px;
    font-weight: 700;
}

.mine h2 {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 10px;
}

.mine-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e2129;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.mine-row .info {
    font-size: 14px;
}

.mine-row .time {
    color: #888;
    font-size: 12px;
    margin-left: 8px;
}

.del-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 18px;
    padding: 4px 8px;
}

.loading, .empty {
    color: #777;
    font-size: 14px;
    padding: 10px 0;
}

/* --- Tanken Button --- */
.tanken-btn {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    max-width: 448px;
    margin: 0 auto;
    padding: 18px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #1a1a1a;
    box-shadow: 0 6px 20px rgba(251, 133, 0, 0.4);
}

/* --- Popup --- */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
}

.popup-overlay.hidden {
    display: none;
}

.popup {
    background: #1e2129;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 30px;
}

.popup h2 {
    text-align: center;
    margin-top: 0;
}

.drink-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.drink-btn {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 14px;
    border: none;
    background: #2a2e38;
    color: #fff;
}

.drink-btn:active {
    background: #ffb703;
    color: #1a1a1a;
}

.cancel-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
}

/* --- Toast --- */
.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #2a2e38;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 100;
}

.toast.hidden {
    display: none;
}
