/* =================== Riddle Room game =================== */
body.rg-open { overflow: hidden; }

.rg-fab {
  position: fixed; z-index: 24; right: var(--gutter, 24px); bottom: 96px;
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 18px 6px 6px;
  border: 0; border-radius: 999px; cursor: pointer; color: #1a1208;
  background: linear-gradient(135deg, #ffcf4d, #f5a316);
  box-shadow: 0 10px 30px rgba(184, 110, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font: 800 11px/1 Manrope, sans-serif; letter-spacing: .16em; text-transform: uppercase;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, opacity .3s;
  animation: rg-pop .7s cubic-bezier(.2, .7, .2, 1) 1.2s both;
}
.rg-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 36px rgba(184, 110, 0, 0.45); }
.rg-fab__icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: #1f1a24; color: #ffcf4d; font: 700 24px/1 "Cormorant Garamond", Georgia, serif;
  animation: rg-wiggle 4s ease-in-out 3s infinite;
}
@keyframes rg-pop { from { opacity: 0; transform: translateY(16px) scale(.9); } }
@keyframes rg-wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-14deg); } 94% { transform: rotate(12deg); } 97% { transform: rotate(-6deg); } }
body.rg-open .rg-fab { opacity: 0; pointer-events: none; }

.rg-backdrop { position: fixed; inset: 0; z-index: 41; background: rgba(40, 30, 20, 0.22); opacity: 0; transition: opacity .3s; }
.rg-backdrop.is-on { opacity: 1; }
.rg-backdrop[hidden], .rg[hidden] { display: none; }

.rg {
  position: fixed; z-index: 42; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  display: flex; flex-direction: column; color: #1f1a24; background: #fffdf8;
  box-shadow: -20px 0 60px rgba(70, 50, 30, 0.22); border-left: 1px solid rgba(31, 26, 36, 0.1);
  font: 400 15px/1.55 Manrope, sans-serif;
  transform: translateX(100%); transition: transform .38s cubic-bezier(.2, .7, .2, 1);
}
.rg.is-on { transform: none; }
.rg :focus-visible { outline: 2px solid #b86e00; outline-offset: 2px; }
.rg__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 22px 24px 14px; border-bottom: 1px solid rgba(31, 26, 36, 0.08);
  background: radial-gradient(ellipse at 0% 0%, rgba(255, 207, 77, 0.28), transparent 60%);
}
.rg__kicker { margin: 0; font: 800 10.5px Manrope, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #b86e00; }
.rg__title { margin: 2px 0 0; font: 600 38px/1 "Cormorant Garamond", Georgia, serif; }
.rg__close { width: 44px; height: 44px; flex: none; border: 1px solid rgba(31, 26, 36, 0.14); background: #fff; cursor: pointer; font-size: 15px; color: #1f1a24; }
.rg__close:hover { border-color: #f5ad16; }
.rg__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px 28px; }
.rg__confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rg__lead { margin: 0 0 18px; color: rgba(31, 26, 36, 0.72); }
.rg__label { margin: 16px 0 8px; font: 800 10.5px Manrope, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(31, 26, 36, 0.55); }
.rg__best { margin: 14px 0 0; text-align: center; font-size: 13px; color: rgba(31, 26, 36, 0.6); }
.rg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* start screen */
.rg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rg-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(31, 26, 36, 0.14); background: #fff; color: #1f1a24; font: 600 13px Manrope, sans-serif;
}
.rg-chip span { color: #b86e00; font-weight: 800; }
.rg-chip[aria-checked="true"] { background: #1f1a24; color: #fff; border-color: #1f1a24; }
.rg-chip[aria-checked="true"] span { color: #ffcf4d; }
.rg-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rg-mode {
  display: grid; gap: 2px; text-align: left; padding: 12px 14px; cursor: pointer;
  border: 1px solid rgba(31, 26, 36, 0.14); background: #fff; color: #1f1a24; font: 400 12.5px/1.4 Manrope, sans-serif;
}
.rg-mode strong { font: 700 15px Manrope, sans-serif; }
.rg-mode span { color: rgba(31, 26, 36, 0.6); }
.rg-mode[aria-checked="true"] { border-color: #f5ad16; background: #fff7e3; box-shadow: inset 0 0 0 1px #f5ad16; }
.rg-rules { margin: 18px 0 20px; padding: 14px 16px 14px 32px; background: #f7f2e8; font-size: 13px; color: rgba(31, 26, 36, 0.75); }
.rg-rules li { margin: 3px 0; }

/* buttons */
.rg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; cursor: pointer;
  border: 1px solid rgba(31, 26, 36, 0.16); background: #fff; color: #1f1a24; font: 700 12.5px Manrope, sans-serif;
  transition: background .2s, border-color .2s, transform .15s;
}
.rg-btn small { font-weight: 600; color: rgba(31, 26, 36, 0.5); }
.rg-btn:hover:not(:disabled) { border-color: #f5ad16; background: #fffaf0; }
.rg-btn:active:not(:disabled) { transform: translateY(1px); }
.rg-btn:disabled { opacity: .45; cursor: default; }
.rg-btn--primary { background: #f5ad16; border-color: #f5ad16; color: #1a1208; font-weight: 800; letter-spacing: .04em; }
.rg-btn--primary:hover:not(:disabled) { background: #ffc23d; border-color: #ffc23d; }
.rg-btn--ghost { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; color: rgba(31, 26, 36, 0.65); }
.rg-btn--wide { width: 100%; min-height: 50px; font-size: 14px; }

/* playing */
.rg-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.rg-bar__q { flex: 1; color: rgba(31, 26, 36, 0.65); }
.rg-bar__streak { padding: 3px 9px; border-radius: 999px; background: #f2ede4; font-weight: 700; }
.rg-bar__streak.is-hot { background: #ffe1c7; color: #c2410c; animation: rg-pulse 1s ease-in-out infinite; }
@keyframes rg-pulse { 50% { transform: scale(1.08); } }
.rg-bar__score b { font: 700 22px "Cormorant Garamond", Georgia, serif; color: #b86e00; }
.rg-progress { height: 4px; margin: 10px 0 14px; background: #efe9de; border-radius: 4px; overflow: hidden; }
.rg-progress span { display: block; height: 100%; background: linear-gradient(90deg, #e0601e, #f5ad16); transition: width .5s; }
.rg-timer { position: relative; height: 26px; margin: -4px 0 12px; background: #f2ede4; border-radius: 6px; overflow: hidden; }
.rg-timer span { position: absolute; inset: 0; background: linear-gradient(90deg, #2e9e5b, #7ccf6b); transform-origin: left; }
.rg-timer.is-low span { background: linear-gradient(90deg, #c62a2a, #ff7a59); }
.rg-timer em { position: absolute; right: 10px; top: 4px; font: 800 12px Manrope, sans-serif; font-style: normal; color: #1f1a24; }

.rg-card {
  position: relative; padding: 22px 22px 20px; border-radius: 4px; color: #f4f4e8;
  background: radial-gradient(ellipse at 20% 0%, #2f4a3a 0%, #22362a 55%, #1b2b21 100%);
  box-shadow: inset 0 0 0 6px #6b4a2e, inset 0 0 0 8px #3f2a19, 0 10px 24px rgba(40, 30, 20, 0.18);
}
.rg-card.shake { animation: rg-shake .4s; }
@keyframes rg-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.rg-card__cat { margin: 0 0 8px; font: 800 10.5px Manrope, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #ffd76a; }
.rg-card__q { margin: 0; font: 600 25px/1.3 Caveat, "Segoe Print", cursive; }
.rg-hint { margin-top: 14px; padding: 10px 12px; border: 1px dashed rgba(255, 215, 106, 0.6); font: 600 19px/1.3 Caveat, cursive; color: #ffe9a8; animation: rg-pop .35s both; }
.rg-hint[hidden] { display: none; }
.rg-hint span, .rg-reveal span { display: block; margin-bottom: 2px; font: 800 9.5px Manrope, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 233, 168, 0.75); }
.rg-reveal { margin-top: 14px; padding: 10px 12px; background: rgba(255, 255, 255, 0.08); border-left: 3px solid #ff9b85; animation: rg-pop .35s both; }
.rg-reveal.is-good { border-left-color: #7ccf6b; }
.rg-reveal strong { font: 700 26px/1.15 Caveat, cursive; color: #fff; }

.rg-answer { display: flex; gap: 8px; margin-top: 14px; }
.rg-answer[hidden], .rg-options[hidden] { display: none; }
.rg-input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 0;
  border: 1px solid rgba(31, 26, 36, 0.18); background: #fff; color: #1f1a24; font: 500 16px Manrope, sans-serif;
}
.rg-input:focus { outline: none; border-color: #f5ad16; box-shadow: 0 0 0 3px rgba(245, 173, 22, 0.25); }
.rg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.rg-opt {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; text-align: left; cursor: pointer;
  border: 1px solid rgba(31, 26, 36, 0.16); background: #fff; color: #1f1a24; font: 600 13.5px/1.25 Manrope, sans-serif;
}
.rg-opt span { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #f2ede4; font-size: 11px; font-weight: 800; }
.rg-opt:hover:not(:disabled) { border-color: #f5ad16; }
.rg-opt.is-right { background: #e3f6e7; border-color: #2e9e5b; opacity: 1; }
.rg-opt.is-right span { background: #2e9e5b; color: #fff; }
.rg-opt.is-wrong { background: #fde8e4; border-color: #c62a2a; }
.rg-feedback { min-height: 1.5em; margin: 10px 0 6px; font-weight: 700; font-size: 14px; }
.rg-feedback[data-tone="good"] { color: #1e7a46; }
.rg-feedback[data-tone="bad"] { color: #c0392b; }
.rg-feedback[data-tone="info"] { color: #8a5300; }
.rg-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* results */
.rg-end { text-align: center; }
.rg-end__score { margin: 8px 0 0; }
.rg-end__score b { display: block; font: 600 84px/1 "Cormorant Garamond", Georgia, serif; color: #b86e00; }
.rg-end__score span { font: 800 11px Manrope, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(31, 26, 36, 0.55); }
.rg-end__rank { margin: 14px 0 4px; font: 600 32px/1.1 "Cormorant Garamond", Georgia, serif; }
.rg-end__line { margin: 0; color: rgba(31, 26, 36, 0.65); }
.rg-end__best { display: inline-block; margin: 12px auto 0; padding: 6px 14px; border-radius: 999px; background: #fff1cc; font-weight: 800; color: #8a5300; }
.rg-end__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; }
.rg-end__stats div { padding: 12px 6px; background: #f7f2e8; }
.rg-end__stats dt { font: 700 26px "Cormorant Garamond", Georgia, serif; }
.rg-end__stats dd { margin: 0; font: 800 9.5px Manrope, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: rgba(31, 26, 36, 0.55); }
.rg-recap { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; font-size: 13.5px; }
.rg-recap li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 7px 4px; border-bottom: 1px solid rgba(31, 26, 36, 0.07); }
.rg-recap .ok span:first-child { color: #1e7a46; font-weight: 800; }
.rg-recap .no span:first-child { color: #c0392b; font-weight: 800; }
.rg-recap b { color: #b86e00; }
.rg-end__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rg-end__actions .rg-btn--ghost { grid-column: 1 / -1; }
.rg-share-msg { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; color: #1e7a46; }

/* phones: a bottom sheet, launcher in the top-right */
@media (max-width: 760px), (max-aspect-ratio: 1/1.05) {
  .rg-fab { bottom: auto; top: 64px; right: 12px; min-height: 44px; padding: 4px 14px 4px 4px; font-size: 10px; }
  .rg-fab__icon { width: 34px; height: 34px; font-size: 20px; }
  .rg {
    top: auto; left: 0; width: 100%; height: min(88vh, 720px);
    border-left: 0; border-top: 1px solid rgba(31, 26, 36, 0.1); border-radius: 18px 18px 0 0;
    transform: translateY(100%); box-shadow: 0 -20px 60px rgba(70, 50, 30, 0.25);
  }
  .rg__head { padding: 16px 18px 12px; border-radius: 18px 18px 0 0; }
  .rg__title { font-size: 32px; }
  .rg__body { padding: 14px 18px 24px; }
  .rg-card__q { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-fab, .rg-fab__icon, .rg-bar__streak.is-hot { animation: none; }
}

/* phones: icon-only launcher in the header row, clear of the card and the HUD */
@media (max-width: 760px), (max-aspect-ratio: 1/1.05) {
  .rg-fab { top: 14px; right: 12px; min-height: 44px; width: 44px; padding: 4px; justify-content: center; }
  .rg-fab__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .rg-fab { bottom: auto; top: 10px; right: 12px; min-height: 40px; width: 40px; padding: 3px; justify-content: center; }
  .rg-fab__icon { width: 34px; height: 34px; font-size: 20px; }
  .rg-fab__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* =================== simpler, rounder panel =================== */
/* a floating card with rounded corners, inset from the edges of the screen */
.rg {
  top: 50%; right: 24px; bottom: auto; left: auto; width: min(400px, calc(100vw - 48px));
  height: auto; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px);
  border: 1px solid rgba(31, 26, 36, 0.08); border-radius: 28px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(70, 50, 30, 0.28), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  transform: translate(calc(100% + 40px), -50%); transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.rg.is-on { transform: translate(0, -50%); }
.rg__head { align-items: center; padding: 18px 18px 14px 20px; border-bottom: 0; }
.rg__brand { display: flex; align-items: center; gap: 12px; }
.rg__icon {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px;
  background: #1f1a24; color: #ffcf4d; font: 700 24px/1 "Cormorant Garamond", Georgia, serif;
}
.rg__kicker { font-size: 9.5px; }
.rg__title { font-size: 28px; }
.rg__close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(31, 26, 36, 0.06); font-size: 13px; }
.rg__close:hover { background: rgba(245, 173, 22, 0.2); }
.rg__body { padding: 4px 20px 22px; }

/* rounded controls throughout */
.rg-btn { border-radius: 14px; }
.rg-btn--wide { border-radius: 16px; min-height: 52px; }
.rg-btn--soft { background: rgba(31, 26, 36, 0.05); border-color: transparent; }
.rg-btn--soft:hover:not(:disabled) { background: rgba(245, 173, 22, 0.16); border-color: transparent; }
.rg-btn--ghost { text-decoration: none; }
.rg-btn--ghost:hover:not(:disabled) { background: rgba(31, 26, 36, 0.05); border-color: transparent; }
.rg-input { border-radius: 14px; }
.rg-card { border-radius: 20px; padding: 20px 20px 18px; box-shadow: inset 0 0 0 5px #6b4a2e, inset 0 0 0 7px #3f2a19, 0 10px 24px rgba(40, 30, 20, 0.16); }
.rg-hint, .rg-reveal { border-radius: 12px; }
.rg-timer { border-radius: 999px; height: 8px; margin: -4px 0 14px; }
.rg-timer em { top: -20px; right: 0; font-size: 11px; }
.rg-progress { height: 6px; border-radius: 999px; margin: 10px 0 16px; }

/* start screen */
.rg-start { display: grid; gap: 4px; padding-top: 6px; }
.rg-start__big { margin: 0; font: 600 30px/1.1 "Cormorant Garamond", Georgia, serif; }
.rg-start .rg__lead { margin: 0 0 18px; }
.rg-switch {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; cursor: pointer;
  background: rgba(31, 26, 36, 0.04); font: 700 14px Manrope, sans-serif;
}
.rg-switch small { display: block; font-weight: 500; font-size: 12px; color: rgba(31, 26, 36, 0.55); }
.rg-switch input { position: absolute; opacity: 0; pointer-events: none; }
.rg-switch__track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: rgba(31, 26, 36, 0.18); transition: background .2s; }
.rg-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .2s; }
.rg-switch input:checked + .rg-switch__track { background: #f5ad16; }
.rg-switch input:checked + .rg-switch__track::after { transform: translateX(18px); }
.rg-switch input:focus-visible + .rg-switch__track { outline: 2px solid #b86e00; outline-offset: 2px; }

/* while playing */
.rg-bar__q b { color: #1f1a24; }
.rg-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rg-tools .rg-btn--wide { grid-column: 1 / -1; }
.rg-feedback { margin: 10px 0 8px; }

/* results */
.rg-end__score b { font-size: 72px; }
.rg-end__rank { font-size: 28px; }
.rg-end__stats { grid-template-columns: 1fr 1fr; margin: 18px 0; }
.rg-end__stats div { border-radius: 16px; }
.rg-end__actions .rg-btn { min-height: 50px; }

/* phones: the same rounded card, floating above the bottom edge */
@media (max-width: 760px), (max-aspect-ratio: 1/1.05) {
  .rg {
    top: auto; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto;
    height: auto; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px);
    border-radius: 26px; border-top: 1px solid rgba(31, 26, 36, 0.08);
    transform: translateY(calc(100% + 30px));
  }
  .rg.is-on { transform: none; }
  .rg__head { padding: 14px 14px 10px 16px; border-radius: 0; }
  .rg__icon { width: 38px; height: 38px; border-radius: 12px; font-size: 21px; }
  .rg__title { font-size: 25px; }
  .rg__body { padding: 2px 16px 18px; }
  .rg-start__big { font-size: 26px; }
  .rg-card__q { font-size: 22px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .rg { top: 12px; bottom: 12px; right: 12px; left: auto; width: min(400px, 60vw); max-height: none; transform: translateX(calc(100% + 30px)); }
  .rg.is-on { transform: none; }
}
.rg-feedback:empty { min-height: 0; margin: 12px 0 0; }
.rg-backdrop { background: rgba(40, 30, 20, 0.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* quieter launcher so the gold "Contact us" button is the one clear call to action */
.rg-fab { background: #fffdf8; color: #1f1a24; box-shadow: 0 10px 28px rgba(70, 50, 30, 0.2), inset 0 0 0 1px rgba(31, 26, 36, 0.08); }
.rg-fab:hover { box-shadow: 0 14px 34px rgba(70, 50, 30, 0.28), inset 0 0 0 1px rgba(245, 173, 22, 0.6); }
/* contrast */
.rg__kicker, .rg-bar__score b, .rg-end__score b, .rg-end__best { color: #8a5300; }
.rg__label, .rg-switch small, .rg-end__score span, .rg-end__stats dd, .rg-bar__q, .rg__best, .rg__lead, .rg-btn small { color: rgba(31, 26, 36, 0.7); }
