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

html, body, h1, h2, p, form, label, input, button {
    margin: 0;
    padding: 0;
    border: none;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-size: 16px;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: #161616;
    color: #EEEEEE;
    padding: 24px 16px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.site-name {
    text-align: center;
    color: #885522;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    margin-bottom: -4px;
}

h1 {
    font-size: 2.4rem;
    font-weight: bold;
    color: #EE9933;
    text-shadow: 0 0 16px #CC6611;
    text-align: center;
    margin-bottom: 8px;
}

h2 {
    font-size: 1.3rem;
    font-weight: normal;
    color: #FFCC77;
}

p {
    line-height: 1.5rem;
    color: #DDDDDD;
}

a {
    color: #EE9933;
    text-decoration: none;
}

a:hover, a:focus {
    color: #EEEEEE;
}

.error {
    color: #EE6622;
    font-weight: bold;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #FFCC77;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
select {
    background-color: rgba(80, 40, 10, 0.4);
    color: #EEEEEE;
    border: 2px solid #885522;
    border-radius: 6px;
    padding: 14px 12px;
    font-size: 1.1rem;
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%23EE9933' d='M0 0l6 8 6-8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 40px;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #EE9933;
}

button {
    background-color: #EE9933;
    color: #161616;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 14px 20px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    min-height: 52px;
}

button:hover, button:focus {
    background-color: #FFCC77;
}

button {
    transition: transform 80ms ease, background-color 100ms ease;
}

a.btn-primary {
    display: block;
    width: fit-content;
    margin-left: auto;
    background-color: #EE9933;
    color: #161616;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 100ms ease;
}

a.btn-primary:hover, a.btn-primary:focus {
    background-color: #FFCC77;
}

button:active {
    transform: scale(0.96);
}

.muted {
    font-size: 0.9rem;
    color: #AAAAAA;
    text-align: center;
}

.intro {
    font-size: 0.95rem;
    color: #CCCCCC;
    line-height: 1.4;
    margin-bottom: 8px;
}

.intro strong {
    color: #FFCC77;
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.amount-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 68px;
    padding: 10px 8px;
    border: 2px solid #885522;
    border-radius: 6px;
    background: #1f1f1f;
    color: #FFCC77;
    text-decoration: none;
    transition: background-color 100ms ease, border-color 100ms ease;
}

.amount-main {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.1;
}

.amount-sub {
    font-size: 0.8rem;
    color: #AAAAAA;
    line-height: 1.1;
    text-align: center;
}

.amount-btn:hover, .amount-btn:focus {
    border-color: #EE9933;
    background: #2a1f10;
}

.amount-btn-active {
    border-color: #EE9933;
    background: #2a1f10;
    color: #EE9933;
}

.amount-btn-weak {
    border-color: #553311;
    background: #181818;
    color: #AAAAAA;
    opacity: 0.85;
}

.amount-btn-weak .amount-sub {
    color: #888888;
}

.amount-link {
    color: #FFCC77;
    text-decoration: underline;
}

.muted-left {
    font-size: 0.9rem;
    color: #AAAAAA;
}

.user-self {
    color: #888888;
    cursor: not-allowed;
}

.muted-inline {
    color: #888888;
    font-size: 0.85rem;
    font-style: italic;
}

.history-sub {
    margin-top: 18px;
    opacity: 0.85;
}

h3 {
    font-size: 1.1rem;
    font-weight: normal;
    color: #FFCC77;
    margin-bottom: 10px;
}

section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.total-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px;
    background-color: rgba(80, 40, 10, 0.4);
    border: 2px solid #885522;
    border-radius: 8px;
}

.total-label {
    color: #FFCC77;
    font-size: 0.95rem;
}

.total-value {
    color: #EE9933;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 12px #CC6611;
}

.total-box-settled {
    border-color: #3a7a44;
    background-color: rgba(30, 80, 40, 0.35);
}

.total-settled {
    color: #66cc77;
    font-size: 1.6rem;
    font-weight: bold;
    text-shadow: 0 0 12px #2a6633;
}

.total-breakdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 6px;
    margin-top: 4px;
    font-size: 0.82rem;
    color: #889988;
}

.for-free-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    margin-bottom: 12px;
    min-height: 52px;
    border: 2px solid #885522;
    border-radius: 6px;
    background: #1f1f1f;
    color: #FFCC77;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background-color 100ms ease, border-color 100ms ease;
}

.for-free-toggle input {
    width: 22px;
    height: 22px;
    accent-color: #EE9933;
    margin: 0;
    cursor: pointer;
}

.for-free-toggle:has(input:checked) {
    border-color: #EE9933;
    background: #2a1f10;
    color: #EE9933;
}


.drink-group-heading {
    font-size: 0.95rem;
    font-weight: bold;
    color: #EE9933;
    margin: 14px 0 8px 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.drink-group-heading:first-child {
    margin-top: 0;
}

.drink-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.drink-grid form {
    margin: 0;
}

.drink-btn {
    width: 100%;
    aspect-ratio: 3 / 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px;
    line-height: 1.2;
    color: #161616;
    text-shadow: none;
}

.drink-btn-beer {
    background: linear-gradient(180deg, #f5d088 0%, #c8831a 100%);
}
.drink-btn-beer:hover, .drink-btn-beer:focus {
    background: linear-gradient(180deg, #fadfaa 0%, #dc9228 100%);
}

.drink-btn-radler {
    background: linear-gradient(180deg, #faea7a 0%, #e8b038 100%);
}
.drink-btn-radler:hover, .drink-btn-radler:focus {
    background: linear-gradient(180deg, #fff59a 0%, #f4c048 100%);
}

.drink-btn-sekt {
    background: linear-gradient(180deg, #e890cc 0%, #e8a040 25%, #e8cc55 50%, #90e865 75%, #65b8e8 100%);
}
.drink-btn-sekt:hover, .drink-btn-sekt:focus {
    background: linear-gradient(180deg, #f0a0d8 0%, #f0b055 25%, #f0dc70 50%, #a8f090 75%, #88ccf0 100%);
}

.drink-btn-alc_free_beer {
    background: linear-gradient(180deg, #f5d088 0%, #7099c8 100%);
}
.drink-btn-alc_free_beer:hover, .drink-btn-alc_free_beer:focus {
    background: linear-gradient(180deg, #fadfaa 0%, #88aed8 100%);
}

.drink-btn-alc_free_radler {
    background: linear-gradient(180deg, #faea7a 0%, #7099c8 100%);
}
.drink-btn-alc_free_radler:hover, .drink-btn-alc_free_radler:focus {
    background: linear-gradient(180deg, #fff59a 0%, #88aed8 100%);
}

.drink-btn-soft {
    background: linear-gradient(180deg, #f5b070 0%, #ba6a30 100%);
}
.drink-btn-soft:hover, .drink-btn-soft:focus {
    background: linear-gradient(180deg, #fac488 0%, #cc7a3a 100%);
}

.drink-btn-water {
    background: linear-gradient(180deg, #daeef8 0%, #a8d0e6 100%);
}
.drink-btn-water:hover, .drink-btn-water:focus {
    background: linear-gradient(180deg, #eaf4fc 0%, #bcdcf0 100%);
}

.drink-plus {
    font-size: 1.6rem;
    font-weight: bold;
}

.drink-name {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    word-break: break-word;
}

.drink-price {
    font-size: 0.85rem;
    font-weight: normal;
    opacity: 0.75;
}

.history {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history li {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: rgba(80, 40, 10, 0.2);
    border-radius: 4px;
    font-size: 0.95rem;
}

.hist-delete {
    color: #885522;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.hist-delete:hover, .hist-delete:focus {
    color: #FFCC77;
    background-color: rgba(80, 40, 10, 0.4);
}

.btn-danger {
    background-color: #cc4422;
    color: #ffffff;
}

.btn-danger:hover, .btn-danger:focus {
    background-color: #ee6644;
    color: #ffffff;
}

.confirm-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 16px;
}

.staff-target {
    color: #66ddee;
    background-color: rgba(102, 221, 238, 0.12);
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid rgba(102, 221, 238, 0.4);
}

.self-username {
    color: #EE9933;
    background-color: rgba(238, 153, 51, 0.12);
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid rgba(238, 153, 51, 0.4);
}

.confirm-actions > button,
.confirm-actions > a {
    flex: 1;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    min-height: 52px;
}

.history li:nth-child(odd) {
    background-color: rgba(80, 40, 10, 0.35);
}

.hist-when {
    color: #FFCC77;
    white-space: nowrap;
}

.hist-price {
    color: #DDDDDD;
    white-space: nowrap;
}

.btn-secondary {
    background-color: transparent;
    color: #885522;
    border: 2px solid #885522;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: rgba(80, 40, 10, 0.4);
    color: #FFCC77;
}

.bottom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.bottom-actions form {
    margin: 0;
}

.bottom-actions button {
    width: 100%;
}

.btn-secondary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
    border: 2px solid #885522;
    color: #885522;
    text-decoration: none;
    text-align: center;
    min-height: 52px;
    box-sizing: border-box;
}

.btn-secondary-link:hover, .btn-secondary-link:focus {
    background-color: rgba(80, 40, 10, 0.4);
    color: #FFCC77;
}

.toast {
    background-color: rgba(238, 153, 51, 0.15);
    border: 2px solid #EE9933;
    color: #FFCC77;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    overflow: hidden;
    max-height: 200px;
    animation: toast-in 200ms ease-out, toast-collapse 800ms ease-in-out 5s forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-collapse {
    0% {
        opacity: 1;
        max-height: 200px;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-bottom: 0;
        border-width: 2px;
    }
    40% {
        opacity: 0;
        max-height: 200px;
        padding-top: 12px;
        padding-bottom: 12px;
        border-width: 2px;
    }
    100% {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: calc(-1 * var(--gap, 18px));
        border-width: 0;
    }
}

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

.day-heading {
    font-size: 0.95rem;
    font-weight: bold;
    color: #EE9933;
    margin: 0 0 6px 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.empty-state {
    text-align: center;
    padding: 24px 12px;
    background-color: rgba(80, 40, 10, 0.15);
    border: 1px dashed #885522;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-emoji {
    font-size: 2.5rem;
    margin: 0 0 8px;
    line-height: 1;
}

.empty-state p {
    margin: 0;
}

.link-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.link-btn {
    display: block;
    text-align: center;
    background-color: #EE9933;
    color: #161616;
    font-weight: bold;
    padding: 14px 20px;
    border-radius: 6px;
    transition: transform 80ms ease, background-color 100ms ease;
}

.link-btn:hover, .link-btn:focus {
    background-color: #FFCC77;
    color: #161616;
}

.link-btn:active {
    transform: scale(0.96);
}

.link-btn-secondary {
    background-color: transparent;
    color: #885522;
    border: 2px solid #885522;
}

.link-btn-secondary:hover, .link-btn-secondary:focus {
    background-color: rgba(80, 40, 10, 0.4);
    color: #FFCC77;
}

.progress-wrap {
    position: relative;
    width: 100%;
    height: 28px;
    background-color: rgba(80, 40, 10, 0.4);
    border: 2px solid #885522;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #EE9933;
    box-shadow: 0 0 12px #CC6611;
    transition: width 200ms ease;
}

.progress-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #161616;
    font-weight: bold;
    font-size: 0.95rem;
    mix-blend-mode: screen;
}

.dash-row {
    grid-template-columns: 1fr auto auto;
}

.history li.fin-row {
    grid-template-columns: 1fr auto;
}

.link-btn-paypal {
    background-color: #003087;
    color: #FFFFFF;
}

.link-btn-paypal:hover, .link-btn-paypal:focus {
    background-color: #0070BA;
    color: #FFFFFF;
}
