@media (pointer: none), (pointer: coarse), (max-width: 720px) {
    html,
    body {
        margin: 0;
        padding: 0;
        width: 100%;
        min-height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
        background-color: var(--bg);
    }

    body {
        min-height: 100vh;
        min-height: 100dvh;
        background:
            radial-gradient(circle at 14% 9%, var(--kaarslicht-glow), transparent 30%),
            radial-gradient(circle at 86% 15%, rgba(255, 132, 61, 0.2), transparent 30%),
            repeating-linear-gradient(90deg, rgba(255,255,255,0.028) 0 2px, transparent 2px 58px),
            linear-gradient(180deg, rgba(54, 26, 12, 0.22), rgba(18, 9, 5, 0.78)),
            url("../assets/art/bg-min.jpg") 55% center / cover no-repeat;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .vh-100 {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        padding: max(64px, calc(env(safe-area-inset-top) + 52px)) 14px max(14px, env(safe-area-inset-bottom));
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    .d-flex.flex-column.align-items-center.justify-content-center.h-100 {
        gap: 12px;
    }

    #title-img {
        width: min(86vw, 340px);
        min-height: 98px;
        padding: 14px 18px 18px;
        margin-bottom: 4px;
        font-size: clamp(2.2rem, 12vw, 3.3rem);
    }

    .tavern-logo span:first-child {
        transform: translateX(-7px);
    }

    .tavern-logo span:last-child {
        transform: translateX(7px);
    }

    .txt,
    .btn {
        font-size: clamp(1.45rem, 7vw, 2.35rem);
    }

    .txtshadow {
        text-shadow: 0 3px 0 rgba(58, 24, 5, 0.65), 0 6px 16px rgba(0, 0, 0, 0.28);
    }

    #inGameCode {
        max-width: 46vw;
        min-height: 30px;
        padding: 4px 10px 6px;
        font-size: 0.82rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #\ dropdownWrapper,
    #dropdownWrapper {
        top: max(10px, env(safe-area-inset-top));
        right: max(14px, env(safe-area-inset-right));
        padding-top: 0 !important;
    }

    .dropdown-content {
        width: min(92vw, 320px);
        max-height: min(420px, calc(100dvh - 86px - env(safe-area-inset-bottom)));
        padding: 10px;
        border-radius: 18px;
    }

    .dropdown-content a {
        min-width: 0;
        min-height: 44px;
        padding: 12px 14px;
        text-align: left;
    }

    input {
        width: min(78vw, 310px);
        height: clamp(64px, 14vh, 82px);
        padding: 0 12px;
        font-size: clamp(2rem, 10vw, 2.65rem);
        letter-spacing: 0.18em;
    }

    .btn {
        min-width: min(78vw, 300px);
        min-height: 62px;
        padding: 11px 20px 15px;
    }

    #translateBtn.dropbtn {
        min-width: 46px;
        width: 46px;
        max-width: 52px;
        min-height: 44px;
        height: 44px;
        padding: 4px 8px;
        border-radius: 13px;
        font-size: 0.9rem;
        line-height: 1;
    }

    #coffeeBtn {
        min-height: 56px;
        font-size: clamp(1.05rem, 4.7vw, 1.45rem);
    }

    #waitroomButtonsWrapper,
    #waitRoomButtonsWrapper,
    #endButtonsWrapper {
        width: min(92vw, 360px);
        gap: 12px;
    }

    #shareRoomButton,
    #startGameButton,
    #finishGameButton,
    #shareBtn,
    #enterSentenceButton {
        width: min(78vw, 300px);
    }

    #replayGameButton {
        min-width: min(78vw, 300px);
        width: auto;
        min-height: 62px;
        height: auto;
        border-radius: 14px;
        padding: 11px 20px 15px;
        font-size: clamp(1.45rem, 7vw, 2.35rem);
    }

    #replayGameButton::before {
        content: none;
    }

    #replayGameButton::after {
        inset: 7px 16px auto;
        width: auto;
        height: 14px;
        border: 0;
    }

    #codeBlock {
        width: min(92vw, 430px);
        min-height: 210px;
        padding: 24px 18px;
        margin-bottom: 6px;
    }

    #waitingScreen #codeBlock {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
        width: min(92vw, 430px);
        min-height: 0;
        text-align: center;
    }

    #waitRoomInfo {
        text-align: center;
    }

    #inviteQrCard {
        width: 140px;
        height: 140px;
        padding: 10px;
        border-radius: 16px;
    }

    #inviteQrImage {
        width: 116px;
        height: 116px;
    }

    #codeBlock p {
        margin-bottom: 10px;
    }

    #gameCodeDisplay {
        min-height: 50px;
        margin-left: 4px;
        padding: 5px 13px 7px;
        border-radius: 16px;
        font-size: clamp(1.45rem, 9vw, 2.25rem);
        letter-spacing: 0.1em;
    }

    #playerCount {
        font-size: clamp(0.98rem, 4.6vw, 1.25rem);
    }

    #playerNum {
        min-width: 36px;
        min-height: 36px;
    }

    #hint {
        width: min(92vw, 460px);
        min-height: clamp(116px, 22vh, 160px);
        padding: 18px;
        margin-bottom: 0;
    }

    #sentenceToTypeDisplay {
        font-size: clamp(1.08rem, 5.5vw, 1.65rem);
    }

    .textarea-frame {
        width: min(92vw, 460px);
        height: clamp(210px, 34vh, 320px);
        padding: 14px;
    }

    #sentenceInput {
        padding: 14px;
        font-size: clamp(1.1rem, 5.2vw, 1.55rem);
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    #sentenceInput::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    #enterSentenceButton {
        flex-shrink: 0;
        position: relative;
        z-index: 2;
    }

    body.keyboard-open .textarea-frame {
        height: clamp(150px, 24dvh, 220px);
    }

    body.keyboard-open #enterSentenceButton {
        transform: translateY(-4px);
    }

    #waitingForNextRoundScreen {
        min-height: 100vh;
        min-height: 100dvh;
    }

    #playerWaitCounter {
        width: 100%;
        max-width: 90%;
        margin-inline: auto;
        font-size: clamp(1.4rem, 6vw, 2rem);
        font-weight: 950;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #storyDisplay {
        width: min(96vw, 560px);
        min-height: 0;
        max-height: min(58dvh, 520px);
        padding: clamp(30px, 7vw, 40px) clamp(26px, 7vw, 42px) clamp(54px, 12vw, 68px);
        font-size: clamp(0.95rem, 4.4vw, 1.2rem);
    }

    #storyDisplay::before {
        left: 34px;
        top: 16px;
    }

    #storyDisplay::after {
        inset: 16px;
        right: 16px;
        top: 16px;
        width: auto;
        height: auto;
        border-radius: 16px;
        transform: none;
    }

    #scrollTitle {
        margin-top: 0;
        font-size: clamp(1.25rem, 6vw, 1.85rem);
    }

    #theStory {
        min-height: clamp(180px, 30dvh, 300px);
        max-height: clamp(200px, 34dvh, 340px);
        max-width: min(78vw, 430px);
        margin-top: 10px;
    }

    #storyScreenBottom {
        left: clamp(32px, 8vw, 42px);
        right: clamp(32px, 8vw, 42px);
        bottom: clamp(24px, 6vw, 32px);
        padding-top: 7px;
    }

    #shareBtn {
        min-width: min(78vw, 300px);
        width: min(78vw, 300px);
        height: 58px;
        min-height: 58px;
        padding: 9px 20px 12px;
        visibility: visible;
    }

    #shareBtn::before {
        content: none;
    }

    #scrollStudioName {
        font-size: clamp(0.72rem, 3vw, 0.95rem);
        max-width: 100%;
        white-space: nowrap;
    }

    #codeBlockAlert {
        width: min(88vw, 380px);
        min-height: 210px;
        padding: 24px;
    }

    #customAlertDialog {
        font-size: clamp(1.15rem, 5.2vw, 1.55rem);
    }

    #check {
        width: 50px;
        height: 50px;
    }

    .toast-msg {
        min-width: min(84vw, 260px);
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}
