/* ==========================================================================
   Mahabharat360 · Mystery Rooms — hands-on challenges (deeds)
   The room layout for room.deed, and the stage every deed plays on.
   Loaded only by games that use deeds (Sita ki Khoj).
   ========================================================================== */

/* ---- the room: one line of story, the stage, then clues and hints */
.deed-room { display: grid; gap: 12px; }
.deed-head .kicker { margin: 0; }
.deed-head h1 { font-size: clamp(26px, 6.6vw, 38px); margin: 2px 0 0; }
.deed-head .sanskrit { font-family: var(--font-display); color: var(--accent); font-size: 16px; margin: 2px 0 6px; }
.deed-line { color: var(--text-dim); font-size: 16.5px; max-width: 62ch; }
.deed-line p { margin: 0 0 6px; }
.deed-line p:last-child { margin: 0; }
.deed-main { min-width: 0; }
.deed-card { padding: 0; overflow: hidden; }
.deed-card::before { z-index: 3; }
.deed-card .pz { margin: 0; }
.deed-card .feedback { margin: 0; padding: 0 14px; min-height: 0; }
.deed-card .feedback:not(:empty) { padding: 10px 14px 12px; }
.deed-side { display: grid; gap: 10px; align-content: start; }
.deed-clues { display: flex; flex-wrap: wrap; gap: 8px; }
.deed-clue {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px 8px 10px;
  border-radius: 999px; border: 1px solid var(--line-2, rgba(255,255,255,.16)); background: rgba(255,255,255,.04);
  color: var(--text); font: 600 15px var(--font-body, inherit); cursor: pointer;
}
.deed-clue .dc-i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(227,168,74,.16); font-size: 15px; }
.deed-clue:hover { border-color: var(--gold, #e3a84a); }
.deed-clue:not(.found) .dc-i { box-shadow: 0 0 0 0 rgba(227,168,74,.6); animation: dc-pulse 2.2s ease-out infinite; }
.deed-clue.found { opacity: .82; }
.deed-clue.found .dc-i::after { content: ""; }
@keyframes dc-pulse { 0% { box-shadow: 0 0 0 0 rgba(227,168,74,.55); } 70% { box-shadow: 0 0 0 10px rgba(227,168,74,0); } 100% { box-shadow: 0 0 0 0 rgba(227,168,74,0); } }
.deed-room .hint-row .btn { width: 100%; }
.deed-room.review .deed-main .lock-card { padding: 18px; }

/* laptops and wide tablets: the stage takes the left, the story and clues sit beside it */
@media (min-width: 900px) and (orientation: landscape) {
  .deed-room { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto auto 1fr; grid-template-areas: "bar bar" "main head" "main side"; column-gap: 22px; row-gap: 12px; max-width: 1360px; padding-top: 12px; }
  .deed-room > .review-bar { grid-area: bar; }
  .deed-head { grid-area: head; }
  .deed-head h1 { font-size: 30px; }
  .deed-line { font-size: 15.5px; }
  .deed-main { grid-area: main; }
  .deed-side { grid-area: side; }
  .deed-clues { flex-direction: column; }
  .deed-clue { width: 100%; }
}

/* ---- the stage */
.deed { position: relative; width: 100%; height: 360px; background: #0b0912; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.deed.live { touch-action: none; }
.dd-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dd-hud { position: absolute; left: 10px; right: 10px; top: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; pointer-events: none; font: 700 14px var(--font-body, inherit); color: #fff3cf; text-shadow: 0 1px 3px rgba(0,0,0,.8); z-index: 2; }
.dd-hud:empty { display: none; }
.dd-goal { background: rgba(10,8,18,.55); padding: 4px 10px; border-radius: 999px; }
.dd-goal b { color: #ffd27a; }
.dd-feathers i, .dd-stir i { font-style: normal; opacity: .25; filter: grayscale(1); margin-right: 1px; }
.dd-feathers i.on, .dd-stir i.on { opacity: 1; filter: none; }
.dd-bar { flex: 1; min-width: 90px; max-width: 260px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.dd-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd27a, #ff9a2e); border-radius: inherit; }
.dd-bar.fire i { background: linear-gradient(90deg, #ff6a1a, #ffd27a); }
.dd-bar.dawn i { background: linear-gradient(90deg, #6a7ab0, #ffb347); }
.dd-say { position: absolute; left: 50%; top: 44px; transform: translate(-50%, -8px); width: max-content; max-width: min(92%, 560px); margin: 0; padding: 9px 14px; border-radius: 14px; background: rgba(12,9,20,.82); color: #fff3cf; font: 600 15.5px/1.35 var(--font-body, inherit); text-align: center; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 2; border: 1px solid rgba(246,207,131,.25); }
.dd-say.on { opacity: 1; transform: translate(-50%, 0); }
.dd-say.good { border-color: rgba(124,196,138,.7); }
.dd-ctl.out { position: static; padding: 10px; background: rgba(255,255,255,.03); border-top: 1px solid var(--line, rgba(255,255,255,.1)); }
.dd-ctl { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; z-index: 2; }
.dd-ctl .btn { min-height: 44px; backdrop-filter: blur(4px); background-color: rgba(12,9,20,.6); }
.dd-ctl .btn-primary { background-color: var(--accent); }
.dd-ctl .btn.used { opacity: .35; }
.dd-card { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(10,8,18,.72), rgba(10,8,18,.88)); z-index: 4; }
.dd-card[hidden] { display: none; }
.dd-card-in { max-width: 440px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.dd-card-in h3 { margin: 0; font: 700 clamp(21px, 4.6vw, 27px) var(--font-display); color: #ffd27a; }
.dd-card-in p { margin: 0; color: #f3e9d6; font-size: 16px; line-height: 1.45; }
.dd-card-in .btn { min-width: 200px; }
.deed.won::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px rgba(124,196,138,.7); pointer-events: none; }
.deed:focus { outline: none; }

/* Jambavan's call: the banner holds the top, so messages come up from the bottom */
.dd-roar .dd-say, .dd-song .dd-say, .dd-setu .dd-say { top: auto; bottom: 58px; }

/* how to play: one line for phones, one for laptops (the device in hand comes first) */
.dd-how { display: grid; gap: 6px; width: 100%; max-width: 420px; margin: 2px 0 4px; }
.dd-how-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(246,207,131,.16); font-size: 14.5px !important; line-height: 1.5 !important; }
.dd-how-row b { color: #ffd27a; font-weight: 700; }
.dd-how-i { flex: 0 0 auto; font-size: 17px; line-height: 1.3; }
kbd, .dd-kc kbd { display: inline-block; min-width: 1.7em; padding: 0 .45em; margin: 0 .12em; border-radius: 6px; border: 1px solid rgba(246,207,131,.45); border-bottom-width: 3px; background: rgba(255,243,207,.08); color: #fff3cf; font: 700 .86em/1.6 var(--font-body, inherit); text-align: center; vertical-align: .05em; }
/* while playing on a laptop: the keys, small, in a corner */
.dd-keys { position: absolute; left: 10px; bottom: 10px; z-index: 2; pointer-events: none; padding: 5px 10px; border-radius: 10px; background: rgba(12,9,20,.55); color: #f3e9d6; font: 600 12.5px/1.7 var(--font-body, inherit); opacity: 0; transition: opacity .4s; max-width: calc(100% - 20px); }
.dd-keys.top { top: 10px; bottom: auto; left: auto; right: 10px; max-width: calc(100% - 200px); text-align: right; }
.deed.live .dd-keys { opacity: .92; }
.deed.live .dd-keys.used { opacity: .5; }
.deed.won .dd-keys { opacity: 0; }
@media (pointer: coarse) { .dd-keys { display: none; } }

/* the story cards in Ashoka Vatika wrap into two rows on phones */
.pz .dd-ctl.out .btn { flex: 1 1 30%; max-width: 200px; padding: 0 8px; font-size: 14px; background-color: rgba(255,255,255,.05); }
@media (min-width: 700px) { .pz .dd-ctl.out .btn { flex: 0 1 auto; font-size: 15px; } }
/* in a hands-on room on a wide screen, the guide's small lamp waits on the right, off the stage */
@media (min-width: 960px) { body:has(.deed-room) .g-fab { left: auto; right: max(16px, calc((100vw - 1360px) / 2 + 16px)); } }

/* the ending: lighting Ayodhya */
.ending-play { width: 100%; max-width: 980px; margin: 0 auto 18px; border-radius: var(--radius, 18px); overflow: hidden; border: 1px solid var(--line, rgba(255,255,255,.1)); }

@media (prefers-reduced-motion: reduce) { .deed-clue:not(.found) .dc-i { animation: none; } .dd-say { transition: none; } }

/* big monitors: a bigger stage */
@media (min-width: 1600px) and (orientation: landscape) {
  .deed-room { max-width: 1640px; grid-template-columns: minmax(0, 1fr) 320px; }
  body:has(.deed-room) .g-fab { right: max(16px, calc((100vw - 1640px) / 2 + 16px)); }
}
