/* Wildcat CEO: the walking town, the rooms, the field, the dialogue box, hints, prompt and d-pad. */

/* Overworld canvas */
#overworld { position: absolute; inset: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; background: var(--felt2); cursor: pointer; }
#overworld[hidden], #screen[hidden] { display: none !important; }

/* Rooms and the field (one SVG each) */
.room { width: 100%; height: 100%; display: block; background: var(--felt2); }
.room .hand { font-family: var(--hand); }
.room .type { font-family: var(--type); }
.room .serif { font-family: var(--serif); }
.room .hotspot { cursor: pointer; outline: none; }
.room .hotspot rect { fill: rgba(168,50,42,0); stroke: rgba(168,50,42,0.35); stroke-width: 1.5; stroke-dasharray: 7 5; transition: fill 0.15s, stroke 0.15s; }
.room .hotspot:hover rect, .room .hotspot:focus rect { fill: rgba(168,50,42,0.10); stroke: var(--red); stroke-width: 2.5; }
.room .hotspot text { font-family: var(--hand); font-size: 20px; fill: var(--red); opacity: 0.6; pointer-events: none; paint-order: stroke; stroke: #f7f0dd; stroke-width: 5px; stroke-linejoin: round; font-weight: 600; }
.room .hotspot:hover text, .room .hotspot:focus text { opacity: 1; }
.room .hotspot.well rect { display: none; }
.room .actor { cursor: pointer; outline: none; }
.room .actor image { image-rendering: pixelated; image-rendering: crisp-edges; animation: bob 1.2s steps(2, end) infinite; }
.room .actor:hover image, .room .actor:focus image { filter: brightness(1.15) drop-shadow(0 0 2px #f7f0dd); }
.room .actor .shadow { fill: rgba(0,0,0,0.28); }
.room .actor .tag rect { fill: #f7f0dd; stroke: var(--ink); stroke-width: 1.2; }
.room .actor .tag text { font-family: var(--type); font-size: 11px; text-anchor: middle; fill: var(--ink); letter-spacing: 0.04em; }
.room .actor .badge circle { fill: var(--red); stroke: #f7f0dd; stroke-width: 1.5; }
.room .actor .badge text { fill: #fff; font: 700 11px var(--type); text-anchor: middle; }
.room .plate rect { fill: var(--brass); stroke: #6b5218; stroke-width: 1; }
.room .plate text { font: 700 13px var(--type); fill: #2a1f0c; letter-spacing: 0.08em; }
.room .plate .sub { font-size: 10px; font-weight: 400; letter-spacing: 0.04em; }
@keyframes bob { 0%, 49% { transform: translateY(0); } 50%, 100% { transform: translateY(-4px); } }

/* Hints, prompt, d-pad, drawer handle */
/* The guide card: what to do now, in a readable hand, with the keys underneath */
#hints { position: absolute; left: 12px; bottom: 12px; z-index: 3; background: rgba(251,247,234,0.96); border: 1px solid var(--ink2); border-left: 5px solid var(--red); padding: 8px 14px 7px; pointer-events: none; max-width: min(560px, 62%); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
#hints:empty { display: none; }
#hints .now { font-family: var(--fell); font-size: 15px; line-height: 1.4; color: var(--ink); }
#hints .now b { font-family: var(--type); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); display: block; margin-bottom: 2px; }
#hints .keys { margin-top: 6px; padding-top: 5px; border-top: 1px dotted var(--line); font-family: var(--type); font-size: 11.5px; letter-spacing: 0.03em; color: var(--ink2); }
#hints kbd { display: inline-block; font-family: var(--type); font-size: 10.5px; border: 1px solid var(--ink2); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; margin: 0 2px 0 6px; background: #fbf7ea; color: var(--ink); }
#hints .keys kbd:first-child { margin-left: 0; }
#stage[data-screen="map"] #hints { left: auto; right: 14px; bottom: 8px; max-width: 380px; z-index: 6; }
#stage[data-screen="map"] #hints .keys { display: none; }
#prompt { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 4; font-size: 13px; padding: 8px 18px; background: var(--paper3); border: 2px solid var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
#prompt[hidden] { display: none !important; }
#dpad { position: absolute; right: 14px; bottom: 14px; display: none; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 4px; z-index: 4; touch-action: none; user-select: none; }
#dpad button { padding: 0; font-size: 16px; background: rgba(247,240,221,0.9); }
@media (pointer: coarse) { #stage[data-screen="town"] #dpad { display: grid; } }
#drawer-handle { position: absolute; right: 0; top: 46%; z-index: 4; writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg); background: var(--manila); border: 1px solid #a88a4a; border-left: none; border-radius: 0 6px 6px 0; padding: 14px 6px; font-size: 11px; letter-spacing: 0.16em; box-shadow: 2px 0 8px rgba(0,0,0,0.35); }
#drawer-handle[hidden] { display: none !important; }

/* Dialogue box */
#dialogue { position: fixed; left: 50%; bottom: 212px; transform: translateX(-50%); width: min(900px, 96vw); z-index: 15; }
#dialogue[hidden] { display: none !important; }
#dialogue .dlg { position: relative; display: flex; gap: 16px; background: var(--paper3); border: 2px solid var(--ink); padding: 12px 40px 12px 14px; box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 2px 4px rgba(0,0,0,0.4); background-image: linear-gradient(rgba(43,36,24,0.04) 1px, transparent 1px); background-size: 100% 24px; transform: rotate(-0.2deg); }
#dialogue .portrait { flex: none; }
#dialogue .portrait img { display: block; width: 96px; height: 96px; image-rendering: pixelated; image-rendering: crisp-edges; background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink2); }
#dialogue .body { flex: 1; min-width: 0; }
#dialogue .who b { font-family: var(--serif); font-size: 17px; }
#dialogue .who .title { margin-left: 10px; color: var(--muted); font-family: var(--type); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; }
#dialogue .who .mood { margin-left: 10px; color: var(--red); font-size: 12px; }
#dialogue h3 { margin: 4px 0 0; }
#dialogue .text { font-family: var(--fell); font-size: 15.5px; line-height: 1.45; min-height: 46px; margin: 6px 0 8px; cursor: pointer; white-space: pre-line; }
#dialogue .opts { display: flex; flex-direction: column; gap: 4px; opacity: 0.35; transition: opacity 0.2s; }
#dialogue .dlg.ready .opts { opacity: 1; }
#dialogue .opt { text-align: left; text-transform: none; letter-spacing: 0; font-family: var(--fell); font-size: 13.5px; padding: 6px 10px; background: rgba(255,255,255,0.35); }
#dialogue .opt:hover { background: rgba(168,50,42,0.08); border-color: var(--red); }
#dialogue .opt .n { display: inline-block; width: 18px; height: 18px; border: 1px solid var(--ink); border-radius: 50%; text-align: center; font-size: 10px; line-height: 16px; margin-right: 10px; font-family: var(--type); }
#dialogue .opt .hint { display: block; margin: 2px 0 0 28px; font-family: var(--type); font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
#dialogue .opt.off { opacity: 0.55; cursor: not-allowed; }
#dialogue .opt.off .lbl { text-decoration: line-through; text-decoration-color: rgba(43,36,24,0.4); }
#dialogue .x { position: absolute; top: 6px; right: 8px; border: none; background: none; font-size: 15px; padding: 2px 6px; }
@media (max-width: 860px) { #dialogue { bottom: 160px; } #hints { max-width: calc(100% - 24px); } #hints .now { font-size: 13.5px; } #dialogue .dlg { gap: 10px; padding-right: 30px; } #dialogue .portrait img { width: 64px; height: 64px; } }
@media (prefers-reduced-motion: reduce) { .room .actor image { animation: none; } #drawer { transition: none; } }
