* {
    box-sizing: border-box;
}

:root {
    --bg: #000;
    --fg: #fff;
    --muted: rgba(255,255,255,.68);
    --line: rgba(255,255,255,.18);
    --panel: rgba(255,255,255,.07);
    --panel-strong: rgba(255,255,255,.12);
    --danger: #ff5f5f;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: "MuseoSans_300", "Museo Sans", Arial, sans-serif;
}

body {
    overflow: hidden;
    touch-action: manipulation;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    border-radius: 18px;
    padding: 18px 24px;
    color: #000;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    transition: transform .12s ease, opacity .12s ease;
}

button:active {
    transform: scale(.98);
}

button:disabled {
    cursor: not-allowed;
    opacity: .35;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px 24px;
    color: #fff;
    background: rgba(255,255,255,.08);
    outline: none;
    font-size: clamp(24px, 3vw, 44px);
    text-align: center;
    letter-spacing: .08em;
}

.hidden {
    display: none !important;
}

#app {
    width: 100vw;
    height: 100vh;
    padding: clamp(24px, 3vw, 48px);
}

.topbar {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo {
    max-width: min(420px, 40vw);
    max-height: 74px;
    object-fit: contain;
}

.topbar__meta {
    text-align: right;
    color: var(--muted);
    font-size: clamp(18px, 1.5vw, 28px);
}

.kiosk-label {
    color: #fff;
}

.status-text {
    margin-top: 6px;
}

.view {
    height: calc(100vh - 96px - clamp(24px, 3vw, 48px));
}

.panel,
.badge-prompt {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    text-align: center;
}

.panel {
    max-width: 980px;
    margin: 0 auto;
}

h1 {
    margin: 0;
    font-family: "Museo_700", "MuseoSans_700", "Museo Sans", Arial, sans-serif;
    font-size: clamp(48px, 6vw, 110px);
    line-height: .95;
}

h2 {
    margin: 0 0 22px;
    font-size: clamp(28px, 2.5vw, 44px);
}

p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(22px, 2.2vw, 40px);
}

.hint {
    font-size: clamp(16px, 1.3vw, 24px);
}

.setup-panel form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    width: min(920px, 100%);
}

.badge-prompt {
    position: relative;
}

#badgeInput {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.shop-header {
    height: 150px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.shop-header h1 {
    font-size: clamp(42px, 4vw, 72px);
}

#badgeInfo {
    margin-top: 10px;
    font-size: clamp(18px, 1.5vw, 28px);
}

.balance-card {
    min-width: 280px;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px 26px;
    background: var(--panel);
    text-align: right;
}

.balance-card span {
    display: block;
    color: var(--muted);
    font-size: 20px;
}

.balance-card strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(30px, 3vw, 52px);
}

.shop-layout {
    height: calc(100% - 150px);
    display: grid;
    grid-template-columns: 1fr minmax(360px, 25vw);
    gap: 28px;
    min-height: 0;
}

.items-grid {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: minmax(300px, auto);
    gap: 22px;
}

.item-card {
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    background: var(--panel);
    color: #fff;
    padding: 0;
    text-align: left;
    min-height: 300px;
}

.item-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    background: rgba(255,255,255,.06);
}

.item-card__body {
    padding: 18px;
}

.item-card__name {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.item-card__price {
    margin-top: 10px;
    color: var(--muted);
    font-size: 24px;
}

.cart {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 24px;
    background: var(--panel);
}

.cart-lines {
    flex: 1;
    overflow-y: auto;
}

.cart-lines.empty {
    color: var(--muted);
    font-size: 22px;
}

.cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 22px;
}

.cart-line small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.remove-line {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.14);
}

.cart-total,
.receipt-total {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
    font-size: 28px;
}

.cart-total strong,
.receipt-total strong {
    font-size: 34px;
}

.pay-button {
    margin-top: 22px;
}

.secondary-button {
    margin-top: 12px;
    color: #fff;
    background: transparent;
    border: 1px solid var(--line);
}

.receipt-panel {
    align-items: stretch;
    text-align: left;
}

.receipt-panel h1,
.receipt-panel p {
    text-align: center;
}

.receipt-lines {
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 10px 26px;
    background: var(--panel);
}

.receipt-line {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    font-size: clamp(24px, 2.5vw, 42px);
}

.receipt-line:last-child {
    border-bottom: 0;
}

.new-balance {
    margin-top: 10px;
}

#nextCustomerButton {
    margin-top: 20px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 42px;
    transform: translateX(-50%);
    max-width: min(900px, 90vw);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px 26px;
    background: #fff;
    color: #000;
    font-size: 24px;
    box-shadow: 0 18px 50px rgba(0,0,0,.4);
    z-index: 10;
}

.toast.error {
    background: var(--danger);
    color: #000;
}

@media (max-width: 1100px) {
    body {
        overflow: auto;
    }

    #app {
        min-height: 100vh;
        height: auto;
    }

    .view {
        min-height: calc(100vh - 160px);
        height: auto;
    }

    .setup-panel form,
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-header {
        height: auto;
        margin-bottom: 24px;
        flex-direction: column;
    }

    .cart {
        min-height: 440px;
    }
}


/* Optimierung für Kiosk-Hochformat 1080×1920 */
@media (orientation: portrait) and (min-height: 1400px) {
    #app {
        padding: 36px;
    }

    .topbar {
        height: 112px;
    }

    .logo {
        max-width: 430px;
        max-height: 82px;
    }

    .topbar__meta {
        font-size: 24px;
    }

    .view {
        height: calc(100vh - 112px - 36px);
    }

    .panel,
    .badge-prompt {
        gap: 36px;
    }

    h1 {
        font-size: 86px;
    }

    p {
        font-size: 34px;
    }

    .setup-panel form {
        grid-template-columns: 1fr;
        width: 820px;
    }

    .setup-panel button {
        width: 100%;
    }

    .shop-header {
        height: 170px;
        align-items: flex-start;
    }

    .shop-header h1 {
        font-size: 58px;
    }

    #badgeInfo {
        font-size: 30px;
        margin-top: 12px;
    }

    .balance-card {
        min-width: 260px;
        padding: 18px 24px;
    }

    .balance-card strong {
        font-size: 42px;
    }

    .shop-layout {
        height: calc(100% - 170px);
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) 520px;
        gap: 24px;
    }

    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 270px;
        gap: 18px;
        padding-right: 0;
    }

    .item-card {
        min-height: 270px;
        border-radius: 24px;
    }

    .item-card img {
        height: 155px;
    }

    .item-card__body {
        padding: 16px;
    }

    .item-card__name {
        font-size: 24px;
    }

    .item-card__price {
        font-size: 23px;
    }

    .cart {
        min-height: 0;
        max-height: 520px;
        border-radius: 26px;
        padding: 22px;
    }

    .cart h2 {
        font-size: 36px;
        margin-bottom: 14px;
    }

    .cart-line {
        font-size: 24px;
        padding: 12px 0;
    }

    .cart-lines.empty {
        font-size: 24px;
    }

    .cart-total {
        font-size: 28px;
        margin-top: 14px;
        padding-top: 14px;
    }

    .cart-total strong {
        font-size: 34px;
    }

    .pay-button,
    .secondary-button {
        padding: 18px 24px;
        font-size: 24px;
        border-radius: 18px;
    }

    .receipt-panel {
        max-width: 920px;
    }

    .receipt-line {
        grid-template-columns: 90px 1fr auto;
        font-size: 38px;
    }

    .toast {
        bottom: 52px;
        font-size: 26px;
    }
}

/* Fallback, falls der Screen als 1920×1080 gemeldet wird, aber im Kiosk rotiert dargestellt wird */
@media (width: 1080px) and (height: 1920px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
