:root {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

body {
    font-size: 20px;
    margin: 0;
    background: #0b1220;
    color: #e8eefc;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.container.wide {
    max-width: 1200px;
}

h1 {
    margin: 0 0 16px;
}

.card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.card h2 {
    margin-top: 0;
}

label {
    display: block;
    margin-bottom: 6px;
    opacity: 0.9;
}

input {
    display: flex;
    flex: 1 0 auto;
    font-size: 24px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

.hint {
    opacity: 0.7;
    margin: 8px 0 0;
    font-size: 13px;
}

.muted {
    opacity: 0.75;
}

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

button.cocktail {
    display: flex;
    flex: 1 0 auto;
    text-align: left;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.40);
    color: #fff;
    cursor: pointer;
    white-space: normal;
    min-width: 0;
}

.cocktail-title {
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 8px;
}

.cocktail-ings {
    opacity: 0.85;
    font-size: 20px;
    line-height: 1.35;
    font-weight: lighter;

    white-space: normal;
    word-break: break-word;
    hyphens: auto;

    min-width: 0;
    overflow-wrap: anywhere;
}

.cocktail-action {
    margin-top: 10px;
    font-weight: 700;
    opacity: 0.9;
}

.cocktail {
    padding: 0;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}

.cocktail-card {
    position: relative;
    display: flex;
    flex: 1 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 15, 25, 0.9);
    min-height: 140px;
    white-space: normal;
}

button.cocktail * {
    white-space: normal;
}

.cocktail-content {
    position: relative;
    z-index: 2;
    padding: 14px;
    width: 68%;
    min-width: 0;
}

.cocktail-bg {
    width: 32%;
    background-size: cover;
    background-position: center;
    opacity: 0.65;
    filter: saturate(1.2);
}

@media (max-width: 520px) {
    .cocktail-content {
        width: 100%;
    }
}

.row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.grow {
    flex: 1 1 480px;
}

.order {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    margin-bottom: 10px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.20);
}

.order.NEW {
    border-left: 6px solid rgba(0, 200, 255, 0.8);
}

.order.IN_PROGRESS {
    border-left: 6px solid rgba(255, 200, 0, 0.9);
}

.order.DONE {
    border-left: 6px solid rgba(50, 255, 140, 0.8);
    opacity: 0.85;
}

.order-title {
    font-weight: 800;
    font-size: 18px;
}

.order-sub {
    opacity: 0.8;
    font-size: 13px;
    margin-top: 4px;
}

.pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
    font-size: 13px;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.20);
    color: #fff;
    cursor: pointer;
}

.filter.active {
    background: rgba(255, 255, 255, 0.14);
}

.batch {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
}

.batch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.batch-title {
    font-weight: 900;
    font-size: 18px;
}

.batch-ings {
    opacity: 0.9;
    line-height: 1.45;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 14px;
    border-radius: 999px;
}

.hidden {
    display: none;
}

.order.fading {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.modal-card {
    position: relative;
    margin: 18vh auto 0;
    width: min(520px, calc(100% - 24px));
    background: rgba(20, 30, 55, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.modal-title {
    font-weight: 900;
    font-size: 18px;
    margin-bottom: 8px;
}

.modal-text {
    opacity: 0.95;
    line-height: 1.45;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.20);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.btn.primary {
    background: rgba(255, 255, 255, 0.14);
}

.btn.secondary {
    opacity: 0.9;
}

.modal-footnote {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.7;
}

/* ---------------------------
   Mobile Optimizations
   (put this at the very end)
---------------------------- */

/* Make sizing/padding predictable */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Prevent iOS input zoom + nicer tap behavior */
html {
    -webkit-text-size-adjust: 100%;
}
input, button, textarea, select {
    font-size: 22px; /* avoid iOS zoom */
    touch-action: manipulation;
}

/* Slightly better default spacing on small screens */
@media (max-width: 720px) {
    .container,
    .container.wide {
        padding: 14px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .card {
        padding: 12px;
        border-radius: 14px;
    }

    label {
        margin-bottom: 6px;
    }

    input {
        padding: 12px 12px;
        border-radius: 12px;
    }

    .hint {
        font-size: 12px;
    }

    /* Stack rows vertically instead of trying to fit side-by-side */
    .row {
        flex-direction: column;
        gap: 10px;
    }

    .grow {
        flex: 1 1 auto;
    }

    /* MOBILE: show cocktails in a single column */
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Make the whole cocktail card a large tap target */
    button.cocktail {
        border-radius: 16px;
    }

    .cocktail-card {
        min-height: 132px;
        border-radius: 16px;
    }

    .cocktail-content {
        width: 100%;
        padding: 14px;
    }

    /* Hide bg image on phone for readability (already for 520px, extend it) */
    .cocktail-bg {
        display: none;
    }

    .cocktail-title {
        font-size: 30px;
        margin-bottom: 6px;
        line-height: 1.15;
    }

    .cocktail-ings {
        font-size: 18px;
        line-height: 1.35;
    }

    .cocktail-action {
        margin-top: 10px;
        font-size: 15px;
    }

    /* Orders on phone */
    .order {
        padding: 12px;
        border-radius: 16px;
    }

    .order-title {
        font-size: 16px;
    }

    .order-sub {
        font-size: 12px;
    }

    .pill {
        padding: 7px 10px;
        font-size: 12px;
    }

    /* Filters: horizontally scrollable chips (better on phones) */
    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    .filters::-webkit-scrollbar {
        height: 6px;
    }

    .filter {
        white-space: nowrap;
        padding: 10px 12px;
        border-radius: 999px;
    }

    /* Toast: keep visible above iOS bottom bars */
    .toast {
        bottom: 14px;
        padding: 10px 14px;
        border-radius: 999px;
        max-width: calc(100% - 24px);
        text-align: center;
    }

    /* Modal: make it comfortable on phones */
    .modal-card {
        margin: 10vh auto 0;
        width: min(560px, calc(100% - 20px));
        padding: 14px;
        border-radius: 16px;
    }

    .modal-title {
        font-size: 17px;
    }

    .modal-text {
        font-size: 14px;
        line-height: 1.45;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        padding: 12px 12px;
        border-radius: 999px;
    }
}

/* Tablet / iPad: keep 2 columns, but slightly tighter spacing */
@media (min-width: 721px) and (max-width: 1024px) {
    .container,
    .container.wide {
        padding: 16px;
    }

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

    .cocktail-card {
        min-height: 140px;
    }

    /* On iPad we can show the bg again */
    .cocktail-bg {
        display: block;
        opacity: 0.45; /* more subtle for readability */
    }

    .cocktail-content {
        width: 70%;
    }
}

/* Desktop: keep your existing look, just a small hover affordance */
@media (hover: hover) and (pointer: fine) {
    button.cocktail:hover .cocktail-card {
        transform: translateY(-1px);
        transition: transform 0.15s ease;
    }
}

@media (max-width: 720px) {
    .cocktail-card {
        position: relative;
    }

    /* Background becomes full-card overlay */
    .cocktail-bg {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        opacity: 1;
        filter: saturate(1.15) blur(2px);
    }

    /* Dark overlay for readability */
    .cocktail-card::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            to bottom,
            rgba(10, 15, 25, 0.45),
            rgba(10, 15, 25, 0.65)
        );
        z-index: 1;
    }

    .cocktail-content {
        position: relative;
        z-index: 2;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .cocktail-ings {
        display: flex !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;

        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }

    .cocktail-content {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    button.cocktail {
        min-width: 0 !important;
    }
}
