/* "A day at the office", full screen over the page. See office-rpg.js.
   Kairosoft-style: chunky rounded panels with a navy outline, sky-blue title bars, yellow buttons. */
.has-office-game { overflow: hidden; } /* no scrolling the page behind the game */
.rpg { --navy: #163044; --sky: #2a9ae0; --sky-light: #7fd3ff; --paper: #fffdf6; --sun: #ffd54a; --sun-deep: #f0a81f;
  position: fixed; inset: 0; z-index: 1000; display: none; overflow: hidden; background: #22acf9; color: var(--navy); font-family: inherit; -webkit-tap-highlight-color: transparent; user-select: none; }
.rpg.is-open { display: block; }
.rpg-world { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.rpg.is-dragging .rpg-world { cursor: grabbing; }

/* A Kairosoft panel: white, rounded, a navy outline and a light inner ring. */
.rpg-bar, .rpg-quest, .rpg-dialog, .rpg-panel, .rpg-close { border: 3px solid var(--navy); border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #cfe9f8, 0 4px 0 #0b223366; }

/* The top bar: day and time, time saved, Hover on or off. */
.rpg-hud { position: absolute; z-index: 3; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.rpg-hud > * { pointer-events: auto; }
.rpg-bar { display: flex; align-items: stretch; gap: 0; margin: 0 auto; padding: 4px; overflow: hidden; }
.rpg-bar p { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 12px; font-size: 14px; font-weight: 800; }
.rpg-bar p + p { border-left: 2px dashed #cfe9f8; }
.rpg-date span { padding: 1px 7px; border-radius: 5px; background: var(--sky); color: #fff; font-size: 12px; }
.rpg-date b, .rpg-saved b { min-width: 58px; font-size: 18px; font-variant-numeric: tabular-nums; }
.rpg-saved span { color: #5a7a8c; font-size: 12px; }
.rpg-saved b { color: #1f8a4c; }
.rpg-saved.is-bumped b { animation: rpg-bump .6s ease; }
.rpg-lens { color: #8aa2b0; font-size: 12px !important; text-transform: uppercase; letter-spacing: .06em; }
.is-hover-on .rpg-lens { color: var(--sky); }
.is-hover-on .rpg-lens::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--sky-light); box-shadow: 0 0 0 3px #7fd3ff55; transform: rotate(45deg); }
.rpg-auto { flex: none; height: 46px; padding: 0 14px; border: 3px solid var(--navy); border-radius: 10px; background: var(--paper); color: var(--navy); font: inherit; font-size: 14px; font-weight: 800; white-space: nowrap; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #cfe9f8, 0 4px 0 #0b223366; cursor: pointer; }
.rpg-auto[aria-pressed="true"] { background: linear-gradient(#ffe27a, var(--sun-deep)); box-shadow: 0 4px 0 #0b223366; }
.rpg-auto:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
/* Music on or off: the note is struck through when it's off. */
.rpg-music { position: relative; flex: none; width: 46px; height: 46px; padding: 0; border: 3px solid var(--navy); border-radius: 10px; background: var(--paper); color: var(--navy); font: 700 22px/1 system-ui, sans-serif; cursor: pointer; box-shadow: inset 0 0 0 2px #fff, 0 4px 0 #0b223366; }
.rpg-music[hidden] { display: none; }
.rpg-music[aria-pressed="false"] { color: #8aa2b0; }
.rpg-music[aria-pressed="false"]::after { content: ''; position: absolute; left: 9px; right: 9px; top: 50%; height: 3px; background: #c0392b; rotate: -45deg; border-radius: 2px; }
.rpg-music:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.is-auto .rpg-help { display: block !important; background: var(--navy); }
.rpg-close { flex: none; width: 46px; height: 46px; padding: 0; color: var(--navy); font: inherit; font-size: 26px; font-weight: 800; line-height: 1; cursor: pointer; }

/* Today's goal, top left. */
.rpg-quest { position: absolute; z-index: 2; top: 74px; left: 12px; width: 250px; padding: 0 0 8px; overflow: hidden; }
.rpg-quest h2 { margin: 0 0 6px; padding: 7px 12px; background: linear-gradient(#5ec8f8, var(--sky)); color: #fff; font-size: 14px; line-height: 1.25; text-shadow: 0 1px 0 #0b5a8a; }
/* The case, in one line, above the to-dos all game: what's wrong for Sam. */
.rpg-case { margin: 0 12px 6px; padding: 5px 8px; border-radius: 6px; background: #fff1e8; color: #8a3a12; font-size: 12px; font-weight: 700; line-height: 1.35; }
.rpg-quest ul { margin: 0; padding: 0 12px; list-style: none; }
.rpg-quest li { position: relative; padding-left: 22px; color: var(--navy); font-size: 13px; font-weight: 600; line-height: 1.6; }
.rpg-quest li::before { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border: 2px solid var(--navy); border-radius: 3px; background: #fff; }
.rpg-quest li[data-target] { cursor: pointer; }
.rpg-quest li[data-target]:hover { color: var(--sky); }
.rpg-quest li.is-done { color: #8aa2b0; text-decoration: line-through; }
.rpg-quest li.is-done::before { background: #4fbf7f; box-shadow: inset 0 0 0 2px #fff; }

/* "Talk to Iris" over Maya's head when someone is in reach. Tappable too. */
.rpg-prompt { position: absolute; z-index: 2; left: 0; top: 0; translate: -50% -100%; padding: 4px 10px; border: 2px solid var(--navy); border-radius: 7px; background: var(--sun); color: var(--navy); font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 3px 0 var(--navy); cursor: pointer; }
.rpg-prompt::before { content: 'E'; display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--navy); color: #fff; font-size: 11px; }
@media (hover: none) { .rpg-prompt::before { content: 'Tap'; } }

/* Dialogue: a white box at the bottom, the speaker on a tab, the face in a frame. */
.rpg-dialog { position: absolute; z-index: 4; left: 50%; bottom: 14px; translate: -50% 0; display: flex; gap: 14px; width: min(720px, calc(100% - 20px)); box-sizing: border-box; padding: 14px 16px 14px 14px; cursor: pointer; animation: rpg-pop .2s ease-out; }
.rpg-dialog[hidden] { display: none; }
.rpg-dialog.is-hover { background: #eef8ff; }
/* A phone call: a red speaker tab with a phone, and the box shakes as it rings. */
.rpg-dialog.is-call { background: #fff4f0; }
.is-call .rpg-speaker { background: #e8463a; text-shadow: 0 1px 0 #8a1f15; }
.is-call .rpg-speaker::before { content: '☎ '; }
.rpg.is-ringing .rpg-dialog { animation: rpg-ring .14s steps(2) 8; }
.rpg.is-ringing .rpg-world { animation: rpg-ring .14s steps(2) 8; }
@keyframes rpg-ring { 50% { transform: translateX(3px) rotate(.4deg); } }
.rpg-portrait { flex: none; width: 92px; height: 92px; border: 3px solid var(--navy); border-radius: 8px; background: linear-gradient(#bfe6fb, #e9f6fd); object-fit: cover; image-rendering: pixelated; }
.rpg-portrait { display: block; }
/* Hover's portrait is its mark, on white with room round it. */
.rpg-dialog.is-hover .rpg-portrait { box-sizing: border-box; padding: 12px; background: #fff; object-fit: contain; image-rendering: auto; }
.rpg-portrait[hidden] { display: none; }
.rpg-dialog-body { flex: 1; min-width: 0; }
.rpg-speaker { display: inline-block; margin: -26px 0 6px; padding: 3px 10px; border: 3px solid var(--navy); border-radius: 7px; background: var(--sky); color: #fff; font-size: 13px; font-weight: 800; text-shadow: 0 1px 0 #0b5a8a; }
.is-hover .rpg-speaker { background: var(--navy); }
.is-hover .rpg-speaker::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 1px; background: var(--sky-light); transform: rotate(45deg); vertical-align: 1px; }
/* Under one of Hover's findings: the message, email or sheet row it found it in, with what went wrong. */
.rpg-proof { display: grid; gap: 1px; max-width: 420px; margin: 8px 0 2px; padding: 7px 10px 8px; border: 2px solid #cfe0ea; border-left: 4px solid var(--sky); border-radius: 8px; background: #fff; font-size: 13px; line-height: 1.35; }
.rpg-proof[hidden] { display: none; }
.rpg-proof p { margin: 0; }
.rpg-proof-where { display: flex; align-items: center; gap: 6px; color: #5a7a8c; font-size: 12px; font-weight: 700; }
.rpg-proof-where img { width: 14px; height: 14px; }
.rpg-proof-where b { color: var(--navy); }
.rpg-proof-from { color: #5a7a8c; font-size: 12px; font-weight: 700; }
.rpg-proof-text { color: var(--navy); font-size: 14px; font-weight: 700; }
.rpg-proof-flag { justify-self: start; margin-top: 3px !important; padding: 1px 8px; border-radius: 999px; background: #ffe2dc; color: #b3261e; font-size: 11px; font-weight: 800; }
.rpg-line { min-height: 3em; margin: 0; color: var(--navy); font-size: 17px; font-weight: 600; line-height: 1.45; }
.rpg-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rpg-choices button, .rpg-primary, .rpg-secondary { padding: 8px 16px; border: 3px solid var(--navy); border-radius: 8px; background: linear-gradient(#ffe27a, var(--sun-deep)); color: var(--navy); font: inherit; font-size: 15px; font-weight: 800; box-shadow: 0 3px 0 var(--navy); cursor: pointer; }
.rpg-choices button + button, .rpg-secondary { background: linear-gradient(#fff, #d8eefb); }
.rpg-choices button:active, .rpg-primary:active, .rpg-secondary:active { translate: 0 2px; box-shadow: 0 1px 0 var(--navy); }
.rpg-close:focus-visible, .rpg-choices button:focus-visible, .rpg-primary:focus-visible, .rpg-secondary:focus-visible, .rpg-prompt:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* The end-of-day report. */
.rpg-panel { position: absolute; z-index: 5; left: 50%; top: 50%; translate: -50% -50%; width: min(440px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow-y: auto; box-sizing: border-box; padding: 0 0 18px; text-align: center; animation: rpg-pop .3s cubic-bezier(.2, .9, .3, 1.2); }
.rpg-panel[hidden] { display: none; }
.rpg-panel-title { margin: 0; padding: 10px 14px; background: linear-gradient(#5ec8f8, var(--sky)); color: #fff; font-size: 20px; text-shadow: 0 2px 0 #0b5a8a; }
.rpg-kicker { margin: 8px 0 4px; color: #5a7a8c; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
/* Hover's summary of the day: the Hover mark, a line on what happened, then a row per job with a chip
   saying whether it's done or waits for Maya's OK. */
.rpg-brief { margin: 12px 16px 10px; padding: 10px 12px 8px; border: 2px solid var(--navy); border-radius: 10px; background: #f3faff; text-align: left; }
.rpg-brief header { display: flex; align-items: center; gap: 10px; }
.rpg-brief header img { width: 34px; height: 34px; padding: 4px; box-sizing: border-box; border: 2px solid var(--navy); border-radius: 8px; background: #fff; }
.rpg-brief header p { display: grid; margin: 0; line-height: 1.2; }
.rpg-brief header b { font-size: 15px; }
.rpg-brief header span { color: #5a7a8c; font-size: 12px; font-weight: 700; }
.rpg-brief-lead { margin: 8px 0 4px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.rpg-brief-next { margin: 6px 0 0; color: #5a7a8c; font-size: 12px; font-weight: 700; }
.rpg-summary { margin: 0; padding: 0; list-style: none; text-align: left; }
.rpg-summary li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 2px dashed #cfe9f8; font-size: 13px; font-weight: 600; line-height: 1.35; }
.rpg-summary img { flex: none; width: 34px; height: 34px; border: 2px solid var(--navy); border-radius: 6px; background: #d8eefb; image-rendering: pixelated; }
.rpg-summary span { flex: 1; }
.rpg-summary small { display: block; color: #5a7a8c; font-size: 11px; font-weight: 800; }
.rpg-summary b { flex: none; display: grid; justify-items: end; gap: 2px; padding: 2px 8px; border-radius: 999px; background: #dff5e7; color: #1f8a4c; font-size: 11px; white-space: nowrap; }
.rpg-summary b.is-ok { background: #fff1c2; color: #8a5a00; }
.rpg-summary em { display: none; }
.rpg-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 16px 10px; }
.rpg-totals div { padding: 8px; border: 2px solid var(--navy); border-radius: 8px; background: #eef8ff; }
.rpg-totals dt { color: #5a7a8c; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.rpg-totals dd { margin: 2px 0 0; color: #1f8a4c; font-size: 22px; font-weight: 800; }
.rpg-verdict { margin: 0 16px 14px; font-size: 16px; font-weight: 800; }
.rpg-reward { margin: 0 16px 10px; padding: 10px 12px; border: 3px solid var(--navy); border-radius: 8px; background: linear-gradient(#fff3bf, #ffe27a); box-shadow: 0 3px 0 var(--navy); animation: rpg-pop .4s .3s cubic-bezier(.2, .9, .3, 1.4) both; }
.rpg-reward p { margin: 0; }
.rpg-reward-kicker { display: inline-block; margin-bottom: 4px !important; padding: 1px 8px; border-radius: 5px; background: var(--navy); color: var(--sun); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rpg-reward-title { font-size: 17px; font-weight: 800; line-height: 1.25; }
.rpg-reward-detail { margin-top: 2px !important; color: #7a4a00; font-size: 14px; font-weight: 800; }
.rpg-email { margin: 0 16px 12px; padding: 12px; border: 2px solid var(--navy); border-radius: 8px; background: #eef8ff; text-align: left; }
.rpg-email label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; line-height: 1.35; }
.rpg-email div { display: flex; gap: 8px; }
.rpg-email input { -webkit-user-select: text; user-select: text; flex: 1; min-width: 0; padding: 8px 10px; border: 3px solid var(--navy); border-radius: 8px; background: #fff; color: var(--navy); font: inherit; font-size: 15px; }
.rpg-email input:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.rpg-email-status { margin: 6px 0 0; color: #c2492e; font-size: 13px; font-weight: 700; }
.rpg-email-status:empty { display: none; }
.rpg-email-terms { margin: 8px 0 0; color: #4a5a70; font-size: 12px; line-height: 1.4; }
.rpg-email-done { margin: 0; color: #1f8a4c; font-size: 15px; font-weight: 800; text-align: center; }
.rpg-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 16px; }
a.rpg-secondary { display: inline-block; color: var(--navy); text-decoration: none; }
/* Sharing is optional, so it's a quiet row of links. */
.rpg-share { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; margin: 12px 16px 0; color: #4a6577; font-size: 13px; font-weight: 700; }
.rpg-share a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.rpg-share a:hover { color: var(--sky); }
.rpg-share a:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.rpg-again { display: block; margin: 10px auto 0; padding: 4px 8px; border: 0; background: none; color: #4a6577; font: inherit; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rpg-again:hover { color: var(--navy); }
.rpg-again:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }

.rpg-loading { position: absolute; z-index: 6; left: 50%; top: 50%; translate: -50% -50%; margin: 0; padding: 10px 16px; border: 3px solid var(--navy); border-radius: 10px; background: var(--paper); font-weight: 800; }
.rpg-loading[hidden] { display: none; }
.rpg-help { position: absolute; z-index: 1; right: 12px; bottom: 12px; margin: 0; padding: 4px 10px; border-radius: 6px; background: #163044cc; color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.rpg-dialog:not([hidden]) ~ .rpg-help { display: none; }

/* Turning on Hover: a light sweeps across the office. */
.rpg.is-scanning::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #c8f5ff77, transparent) -40% 0 / 40% 100% no-repeat; animation: rpg-scan 1.1s ease-out forwards; pointer-events: none; }
/* The call with Daniel: Maya on the left of the box, Daniel's caller card on the right. Whoever is
   talking is lit and their name tab sits on their side; the other dims. The office dims behind. */
.rpg-face { position: relative; flex: none; align-self: flex-start; }
.rpg-face:has(.rpg-portrait[hidden]) { display: none; }
.rpg-badge { position: absolute; right: -10px; top: -12px; display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 5px; box-sizing: border-box; border: 3px solid var(--navy); border-radius: 8px; background: var(--sun); font: 900 16px/1 system-ui, sans-serif; }
.rpg-badge[hidden] { display: none; }
.rpg-caller { display: none; }
.rpg-dialog.is-duo { width: min(860px, calc(100% - 20px)); }
.is-duo .rpg-caller { flex: none; display: grid; justify-items: center; align-content: start; gap: 1px; width: 104px; text-align: center; }
.rpg-caller-avatar { display: grid; place-items: center; width: 86px; height: 86px; border: 3px solid var(--navy); border-radius: 8px; background: linear-gradient(#ffd2a8, #f08a3c); color: #fff; font-size: 40px; font-weight: 900; text-shadow: 0 3px 0 #a2521a; }
.rpg-caller b { margin-top: 4px; font-size: 14px; line-height: 1.1; }
.rpg-caller small { color: #5b6b78; font-size: 11px; font-weight: 700; }
.rpg-caller-status { margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: #e8463a; color: #fff; font-size: 11px; font-style: normal; font-weight: 800; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.is-happy .rpg-caller-status { background: #2fae5f; }
.is-duo .rpg-face, .is-duo .rpg-caller { transition: filter .2s, opacity .2s, translate .2s; }
.is-duo:is([data-focus='caller'], [data-focus='ring']) .rpg-face, .is-duo[data-focus='maya'] .rpg-caller { filter: grayscale(.7); opacity: .45; }
.is-duo[data-focus='caller'] .rpg-caller, .is-duo[data-focus='maya'] .rpg-face { translate: 0 -6px; }
.is-duo .rpg-dialog-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.is-duo[data-focus='caller'] .rpg-speaker, .is-duo[data-focus='ring'] .rpg-speaker { align-self: flex-end; }
.is-duo[data-focus='caller'] .rpg-line { text-align: right; }
.is-duo[data-focus='ring'] .rpg-caller { animation: rpg-caller-ring .3s steps(2) infinite; }
.rpg.is-on-call .rpg-world { filter: brightness(.6) saturate(.8); transition: filter .3s; }
@keyframes rpg-caller-ring { 50% { rotate: -5deg; } }
@keyframes rpg-scan { to { background-position: 140% 0; } }
@keyframes rpg-pop { from { opacity: 0; transform: scale(.94); } }
@keyframes rpg-bump { 40% { transform: scale(1.35); } }

@media (max-width: 600px) {
  .is-duo .rpg-caller { width: 70px; }
  .rpg-caller-avatar { width: 60px; height: 60px; font-size: 28px; }
  .rpg-caller small { display: none; }
  .rpg-hud { top: 8px; left: 8px; right: 8px; }
  .rpg-bar { margin: 0; }
  .rpg-bar p { padding: 3px 8px; font-size: 13px; }
  .rpg-date b, .rpg-saved b { min-width: 0; font-size: 15px; }
  .rpg-lens { display: none !important; }
  .rpg-saved span { display: none; }
  .rpg-auto { height: 40px; padding: 0 10px; font-size: 13px; }
  .rpg-music { width: 40px; height: 40px; margin-left: auto; font-size: 19px; }
  .rpg-close { width: 40px; height: 40px; }
  .rpg-quest { top: 62px; left: 8px; width: 200px; }
  .rpg-quest h2 { font-size: 13px; padding: 6px 10px; }
  .rpg-quest li { font-size: 12px; }
  .rpg-case { font-size: 11px; }
  .rpg-proof { font-size: 12px; padding: 6px 8px; }
  .rpg-proof-text { font-size: 13px; }
  .rpg-portrait { width: 64px; height: 64px; }
  .rpg-line { font-size: 15px; }
  .rpg-help { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rpg *, .rpg::after { animation: none !important; }
}
