/* Omertà's base: tokens, type and the shared controls (angled buttons with brass brackets, the hold ring, the
   hold-to-confirm bar, toasts, overlays). Carried over from Alibi's style.css and play.css (lifeisbeta/alibi), the
   sister game, so the two play alike; omerta.css is the city at night on top of it. */
:root {
  --soot: #0b0908;
  --brick: #1a1210;
  --night: #070a0e;
  --hairline: rgba(236, 228, 212, 0.12);
  --candle: #ece4d4;
  --fog: #8d9a96;
  --brass: #b8925a;
  --brass-dim: rgba(184, 146, 90, 0.45);
  --lamp: #f0c27a;
  --moon: #8fa1b5;
  --oxblood: #8e2b2b;
  --oxblood-ink: #a33a35;
  --solved: #c9b68a;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --typed: "Courier Prime", "Courier New", monospace;

  --control-h: 54px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--soot);
  color: var(--candle);
  font-family: var(--body);
  /* Bodoni Moda's largest optical size spaces W/w badly at display sizes; hold it at text-display weight. */
  font-variation-settings: 'opsz' 28;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* Small-caps label: the one structural voice used everywhere */
.label { font-family: var(--body); font-weight: 600; font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass); }

/* Monogram portrait, for a window with no camera. */
.portrait {
  --c: #44606f;
  position: relative; display: inline-grid; place-items: center; flex: none; width: 64px; aspect-ratio: 4 / 5;
  background:
    radial-gradient(70% 60% at 50% 38%, color-mix(in srgb, var(--c) 55%, #f3e9d6 8%), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 45%, var(--soot)), color-mix(in srgb, var(--c) 18%, #070b0c));
  border: 1px solid var(--brass-dim); outline: 1px solid rgba(0, 0, 0, 0.5); outline-offset: -5px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  color: rgba(243, 233, 214, 0.92); font: italic 500 26px/1 var(--display); overflow: hidden;
}
.portrait::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -22%; height: 45%; border-radius: 50% 50% 0 0; background: rgba(0, 0, 0, 0.28); }
.portrait span { position: relative; z-index: 1; transform: translateY(-12%); }

/* Game button: angled corners and brass brackets. */
.pbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: var(--control-h); padding: 0 26px; border: 0; cursor: pointer;
  color: var(--candle); background: linear-gradient(180deg, rgba(30, 24, 21, 0.95), rgba(12, 10, 9, 0.98));
  font: 600 14px var(--body); letter-spacing: 0.2em; text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.pbtn::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--brass), var(--brass)) top left / 24px 1.5px no-repeat,
              linear-gradient(var(--brass), var(--brass)) top left / 1.5px 24px no-repeat,
              linear-gradient(var(--brass), var(--brass)) bottom right / 24px 1.5px no-repeat,
              linear-gradient(var(--brass), var(--brass)) bottom right / 1.5px 24px no-repeat;
  box-shadow: inset 0 0 0 1px rgba(226, 184, 119, 0.25);
}
.pbtn.primary { color: #15110b; background: linear-gradient(180deg, #f6ead2, #d8c6a2); }
.pbtn.primary::before { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); }
.pbtn:active { transform: translateY(1px); filter: brightness(0.92); }
.pbtn:disabled { opacity: 0.35; }
.pbtn.wide { width: 100%; }

/* Forms */
.join-form { display: grid; gap: 18px; }
.join-form label { display: grid; gap: 9px; }
.join-form input {
  height: var(--control-h); width: 100%;
  border: 1px solid rgba(226, 184, 119, 0.3); border-radius: 0;
  background: rgba(8, 6, 5, 0.75); color: var(--candle);
  font: 500 19px var(--body); padding: 0 16px; outline: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.join-form input::placeholder { color: rgba(141, 154, 150, 0.5); }
.join-form input:focus { border-color: var(--brass); background: rgba(14, 11, 9, 0.92); }
#codeInput { font: 700 28px var(--typed); letter-spacing: 0.45em; text-transform: uppercase; }
.form-error { color: #e0948a; margin: 0; font-size: 15px; }

/* Press-and-hold ring */
.hold {
  position: relative; width: 132px; height: 132px; border-radius: 50%; border: 0;
  background: radial-gradient(circle, rgba(30, 24, 21, 0.95) 58%, rgba(12, 10, 9, 1) 60%);
  color: var(--candle); display: grid; place-items: center; touch-action: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.hold svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold .track { stroke: rgba(226, 184, 119, 0.2); }
.hold .fill { stroke: var(--brass); stroke-dasharray: 377; stroke-dashoffset: 377; filter: drop-shadow(0 0 6px rgba(226, 184, 119, 0.6)); }
.hold.holding .fill { transition: stroke-dashoffset 0.9s linear; stroke-dashoffset: 0; }
.hold span { position: relative; font: 600 11px var(--body); letter-spacing: 0.22em; text-transform: uppercase; text-align: center; line-height: 1.5; }
.hold .icon { width: 26px; height: 26px; display: block; margin: 0 auto 6px; color: var(--brass); }
.hint { color: var(--fog); font-size: 13.5px; text-align: center; margin: 18px 0 0; line-height: 1.5; }
.ready-done { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--brass); font: 600 12px var(--body); letter-spacing: 0.22em; text-transform: uppercase; padding: 14px; }
.ready-done .icon { width: 18px; height: 18px; }

/* Role card text */
.goal { padding: 14px 16px; border-left: 2px solid var(--brass); background: rgba(184, 146, 90, 0.08); }
.goal p { margin: 8px 0 0; line-height: 1.5; font-size: 15.5px; }
.goal.killer { border-left-color: var(--oxblood-ink); background: linear-gradient(90deg, rgba(142, 43, 43, 0.3), rgba(142, 43, 43, 0.08)); }
.goal.killer .label { color: #e0948a; }
.goal.killer p { font: italic 19px/1.4 var(--display); }
.p-text { margin: 0; line-height: 1.6; font-size: 16px; color: rgba(236, 228, 212, 0.88); }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 20; overflow: auto;
  padding: calc(26px + env(safe-area-inset-top)) 20px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; animation: ovIn 0.45s ease both;
}
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }
.ov-center { margin: auto 0; text-align: center; display: grid; gap: 12px; justify-items: center; }
.overlay h2 { font: 400 38px/1.05 var(--display); margin: 0; }
.overlay p { color: var(--fog); margin: 0; line-height: 1.55; font-size: 15.5px; max-width: 30em; }
.linkish { background: none; border: 0; color: var(--fog); text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; margin-top: 16px; cursor: pointer; }

/* Hold to confirm: oxblood for the kill and the vote; brass (omerta.css) for protecting and investigating. */
.accuse {
  position: relative; height: 64px; border: 0; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background: linear-gradient(rgba(142, 43, 43, 0.25), rgba(142, 43, 43, 0.25)), #0d0a09; color: #f3d6d0; font: 600 14px var(--body); letter-spacing: 0.2em; text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.accuse::before { content: ""; position: absolute; inset: 0; background: var(--oxblood-ink); transform: scaleX(0); transform-origin: left; }
.accuse.holding::before { transform: scaleX(1); transition: transform 1s linear; }
.accuse span { position: relative; }
.accuse:disabled { opacity: 0.35; }

.toast {
  position: fixed; left: 14px; right: 14px; top: calc(12px + env(safe-area-inset-top)); z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, rgba(32, 25, 21, 0.98), rgba(14, 11, 9, 0.98)); color: var(--candle);
  border: 1px solid rgba(226, 184, 119, 0.4);
  padding: 14px 16px; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.toast .icon { width: 20px; height: 20px; color: var(--brass); flex: none; }
.toast.in { animation: toastIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes toastIn { from { transform: translateY(-140%); } to { transform: none; } }
@keyframes pip { 50% { opacity: 0.3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
