* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #fff1f6, #f3f7ff);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.card {
    width: min(520px, 100% - 32px);
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
    text-align: center;
}

h1 {
    margin: 0 0 16px;
    font-size: clamp(20px, 5vw, 26px);
}

.playground {
    position: relative;
    width: 100%;
    min-height: 200px;
    height: min(220px, 40vh);
    border-radius: 14px;
    border: 2px dashed rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.playground.has-content {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    height: auto;
    min-height: 200px;
}

.btn {
    padding: 14px 20px;
    min-height: 44px;
    min-width: 44px;
    border-radius: 12px;
    border: 0;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: filter 120ms ease, box-shadow 120ms ease;
}

.btn:active {
    filter: brightness(0.95);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.yes {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(-120%, -50%);
    background: #16a34a;
    color: #fff;
    z-index: 5;
}

.no {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(20%, -50%);
    background: #ef4444;
    color: #fff;
    z-index: 10;
}

.hint {
    margin: 14px 0 0;
    min-height: 20px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
}


.overlay.show {
    display: grid;
}

.overlay-actions {
    padding: 12px 14px 16px;
    display: flex;
    justify-content: center;
}

.restart {
    background: #111;
    color: #fff;
}


.overlay-box {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

.overlay-text {
    margin: 0;
    padding: 12px 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.overlay-box img {
    width: 100%;
    display: block;
}

.hint {
    display: none !important;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    place-items: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 18px;
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: all;
}