* {
    box-sizing: border-box;
}

html {
    background: #111;
}

body {
    margin: 0;

    min-height: 100vh;
    min-height: 100dvh;

    padding:
        env(safe-area-inset-top)
        env(safe-area-inset-right)
        env(safe-area-inset-bottom)
        env(safe-area-inset-left);

    font-family: system-ui, sans-serif;

    background: #111;
    color: #fff;

    overscroll-behavior-y: none;

    -webkit-tap-highlight-color: transparent;
}

main {
    width: min(100%, 600px);

    min-height: 100vh;
    min-height: 100dvh;

    margin: 0 auto;
    padding: 2rem 1.25rem;

    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    margin: 0 0 1rem;

    text-align: center;
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1.2;
    font-weight: 400px;
}

.product-description {
    margin: 0 0 1.5rem;
    font-size: 1.2rem;
    text-align: center;
}

#drink-counts {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

#drink-actions {
    margin-top: 0;
    display: flex;
    justify-content: center;
}

button {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.drink-button {
    width: 130px;
    height: 130px;
    font-size: 3.5rem;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.drink-button.tap {
    animation: beer-tap 160ms ease-out;
}

@keyframes beer-tap {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

#session-reset-actions {
    margin-top: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

#reset-session {
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

#reset-session:hover,
#reset-session:focus-visible {
    color: #fff;
}

/* CSS for PWA installation */
.install-prompt {
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 1rem;

    background: #222;
    border-radius: 12px;

    text-align: center;
}

.install-prompt-content strong {
    font-size: 1rem;
}

.install-prompt p {
    margin: 0.6rem 0 0.75rem;

    color: #bbb;
    font-size: 0.9rem;
    line-height: 1.5;
}

.share-icon {
    display: inline-block;
    margin: 0 0.2rem;

    font-size: 1.2rem;
    font-weight: 700;
}

#dismiss-ios-install {
    border: none;
    background: transparent;

    color: #aaa;
    font-size: 0.85rem;

    padding: 0.5rem 0.75rem;
}

#reset-session {
    width: 100%;
    padding: 0.75rem 1rem;

    border: 1px solid #555;
    border-radius: 10px;

    background: transparent;
    color: #aaa;

    font: inherit;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

#reset-session:hover {
    background: #222;
    color: #fff;
}

/* Group */
#group-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.50rem;
}

.group-actions-caption {
    margin: 0.65rem 0 0;
    color: #aaa;
    font-size: 0.9rem;
    text-align: center;
}

#featured-games {
    width: 100%;
    margin-top: 3rem;
}

#game-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

#game-container:has(.game-card) {
    grid-template-columns: minmax(0, 1fr);
}

.featured-game-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 1.25rem 1rem;
    border: 1px solid #333;
    border-radius: 16px;
    background: #181818;
    text-align: center;
}

@media (max-width: 600px) {
    #game-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
    }

    .featured-game-card {
        padding: 1rem 0.75rem;
    }
}

.featured-game-card.coming-soon {
    border-style: dashed;
    color: #aaa;
}

.featured-game-card span {
    font-size: 2rem;
}

.featured-game-icon {
    display: block;
    width: 2rem;
    height: 2rem;
    margin: 0 auto;
    object-fit: contain;
}

.featured-game-card h3 {
    margin: 0.5rem 0;
}

.featured-game-card p {
    color: #aaa;
}

.featured-game-card button {
    padding: 0.75rem 1.25rem;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.featured-games-heading {
    margin-bottom: 1rem;
}

.featured-games-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.featured-games-heading p {
    margin: 0.35rem 0 0;
    color: #aaa;
    font-size: 0.95rem;
}

#create-a-group {
    width: 100%;
    max-width: 320px;
}

#group-form {
    width: min(100%, 420px);
    margin: 2rem auto 0;
    padding: 1.5rem;
    border: 1px solid #333;
    border-radius: 16px;
    background: #181818;
}

#group-form h2 {
    margin: 0 0 1.5rem;
    text-align: center;
}

#create-group-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

#create-group-form label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

#create-group-form input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid #444;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font: inherit;
}

#create-group-form input:focus {
    outline: none;
    border-color: #777;
}

#create-a-group,
#create-group-form button[type="submit"] {
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

#create-a-group:hover,
#create-group-form button[type="submit"]:hover {
    opacity: 0.9;
}

#create-a-group:active,
#create-group-form button[type="submit"]:active {
    transform: scale(0.98);
}

#create-group-form button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

/* footer */
.site-footer {
    width: 100%;
    margin-top: 4rem;
    padding: 2rem 1rem 1.5rem;
    border-top: 1px solid var(--color-border, #333);
    text-align: center;
}

.footer-brand {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.footer-description {
    margin: 0.5rem 0 1.25rem;
    font-size: 0.95rem;
    opacity: 0.75;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

.footer-nav a {
    color: inherit;
    font-size: 0.95rem;
    text-decoration: none;
    text-underline-offset: 0.25rem;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-nav a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.footer-copyright {
    margin: 1.5rem 0 0;
    font-size: 0.8rem;
    opacity: 0.6;
}
