/* Shared styles for the built-in ALVA ARCADE games. No sounds, no images of living beings. */
body { font-family: var(--font-ar); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 45% at 50% 0%, rgb(var(--primary-rgb) / .14), transparent 70%),
              radial-gradient(ellipse 40% 30% at 100% 100%, rgb(var(--primary-rgb) / .07), transparent 70%); }
.g-wrap { width: min(860px, 100%); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) 1rem 2.5rem; flex: 1; display: flex; flex-direction: column; }
.g-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.g-head h1 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 900; }
.g-head .grow { flex: 1; }
.g-icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line-soft); color: var(--text-dim); background: var(--surface); transition: all .2s; flex: none; }
.g-icon-btn:hover { color: var(--primary-ink); border-color: var(--line); }
.g-icon-btn svg { width: 20px; height: 20px; }

.screen { display: none; flex-direction: column; flex: 1; animation: screen-in .5s var(--ease); }
.screen.is-on { display: flex; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } }

.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: clamp(1.1rem, 3vw, 1.6rem); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1rem; }
.panel h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.panel .hint { margin: 0 0 1rem; color: var(--text-dim); font-size: .9rem; }
.label { display: block; font-weight: 800; font-size: .9rem; color: var(--text-dim); margin: 1.1rem 0 .55rem; }
.label:first-child { margin-top: 0; }

.add-row { display: flex; gap: .5rem; }
.input { flex: 1; min-width: 0; height: 48px; padding: 0 1rem; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / .15); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; min-height: 40px; }
.pchip { display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .5rem 0 .9rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-soft); font-weight: 700; animation: pop .3s var(--ease); }
html[dir='rtl'] .pchip { padding: 0 .9rem 0 .5rem; }
.pchip i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .72rem; font-weight: 900; color: var(--on-primary); background: var(--primary); }
.pchip button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-mute); }
.pchip button:hover { color: var(--danger); background: rgb(239 68 68 / .1); }
.pchip button svg { width: 14px; height: 14px; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.empty-note { color: var(--text-mute); font-size: .9rem; align-self: center; }

.opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; height: 40px; padding: 0 1rem; border-radius: 99px; border: 1px solid var(--line-soft); background: var(--bg); color: var(--text-dim); font-weight: 700; font-size: .9rem; cursor: pointer; transition: all .2s; user-select: none; }
.opt input:checked + span { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.g-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }
.g-actions .btn { min-width: 150px; }
.btn-xl { height: 64px; padding: 0 2.2rem; font-size: 1.15rem; border-radius: 20px; }
.btn-ok { background: linear-gradient(180deg, #34d399, #16a34a); color: #04210f; box-shadow: 0 10px 30px -10px rgb(34 197 94 / .6); }
.btn-ok:hover { transform: translateY(-2px); }
.btn-no { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-soft); }
.btn-no:hover { border-color: rgb(239 68 68 / .5); color: var(--danger); }
.btn-bad { background: linear-gradient(180deg, #f87171, #dc2626); color: #fff; box-shadow: 0 10px 30px -10px rgb(239 68 68 / .6); }
.btn-bad:hover { transform: translateY(-2px); }

.center { text-align: center; }
.big-title { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 900; margin: .2rem 0; line-height: 1.3; }
.sub { color: var(--text-dim); margin: 0; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1rem; padding: 1rem 0; }
.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .85rem; border-radius: 99px; background: var(--tint); border: 1px solid var(--line); color: var(--primary-ink); font-weight: 800; font-size: .82rem; }

/* Scoreboard */
.board { display: flex; flex-direction: column; gap: .5rem; }
.board-row { display: flex; align-items: center; gap: .8rem; padding: .75rem 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); font-weight: 700; animation: screen-in .4s var(--ease) backwards; }
.board-row .rank { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-family: var(--font-en); font-weight: 900; font-size: .9rem; flex: none; }
.board-row.r1 { border-color: var(--primary); background: linear-gradient(90deg, rgb(var(--primary-rgb) / .16), var(--surface-2)); }
.board-row.r1 .rank { background: var(--primary); color: var(--on-primary); }
.board-row.r2 .rank { background: rgb(var(--primary-rgb) / .45); color: var(--text); }
.board-row.r3 .rank { background: rgb(var(--primary-rgb) / .25); }
.board-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .pts { font-family: var(--font-en); font-weight: 900; color: var(--primary-ink); font-size: 1.1rem; }
.board-row .meta { color: var(--text-mute); font-size: .8rem; font-weight: 600; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); display: none; }
.drawer-bg.is-open { display: block; animation: fadein .2s; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(360px, 90vw); z-index: 51; background: var(--surface); border-inline-start: 1px solid var(--line-soft); padding: 1.2rem; transform: translateX(-105%); transition: transform .35s var(--ease); overflow-y: auto; }
html[dir='ltr'] .drawer { transform: translateX(105%); }
.drawer.is-open { transform: none; }
.drawer h2 { margin: 0 0 1rem; display: flex; align-items: center; justify-content: space-between; }
@keyframes fadein { from { opacity: 0; } }

/* Countdown overlay */
.count { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgb(var(--bg-rgb) / .92); backdrop-filter: blur(6px); }
.count b { font-size: clamp(6rem, 25vw, 12rem); font-weight: 900; font-family: var(--font-en); animation: count .9s var(--ease); }
@keyframes count { from { transform: scale(1.8); opacity: 0; } 60% { opacity: 1; } to { transform: scale(.9); opacity: .2; } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
kbd { font-family: var(--font-en); font-size: .75rem; padding: .1rem .4rem; border-radius: 6px; border: 1px solid var(--line-soft); background: var(--surface-2); color: var(--text-mute); }
.kbd-hint { color: var(--text-mute); font-size: .8rem; margin-top: .6rem; }
@media (hover: none) { .kbd-hint { display: none; } }
/* Inside the site's play page the title and theme switch already live in the top bar */
.embedded .g-head h1, .embedded #themeBtn { display: none; }
.embedded .g-head { margin-bottom: .6rem; min-height: 0; }
.embedded .g-head:not(:has(button:not([hidden]):not(#themeBtn))) { display: none; }
