/* "Best played sideways": a phone held upright gets the town as a plain list
 * and a narrow corridor. Shown only on a touch screen in portrait, gone the
 * moment the phone turns; ui/orientation-hint.js remembers a dismissal. The
 * width limit is the town's own portrait cut-off (city-scene.css), so tablets
 * are left alone. It sits in the town's flow above the title rather than
 * floating: an overlay covered window close buttons and, as the portrait town
 * scrolls, its own list. Surface and buttons follow the shared window
 * (windows.css). */
#orientation-hint { display: none; }

@media (orientation: portrait) and (pointer: coarse) and (max-width: 700px) {
  #orientation-hint:not([hidden]) {
    display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px;
    position: relative; z-index: 1; pointer-events: auto; text-align: left;
    width: 100%; margin: 0 0 8px; padding: 10px;
    background: url('../assets/ui/character-surface.svg') repeat, linear-gradient(135deg, #262821, #121a1b 70%);
    border: 1px solid #6e6047; border-radius: 9px;
    box-shadow: 0 6px 18px #0005, inset 0 0 0 3px #101612;
    color: #e8dcc5; font: 400 14px/1.35 "Segoe UI", system-ui, sans-serif; letter-spacing: 0;
  }
}

.orientation-hint-phone { width: 28px; height: 28px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.orientation-hint-arc { stroke: var(--muted); }
.orientation-hint-device { transform-box: fill-box; transform-origin: center; animation: orientation-hint-turn 2.6s ease-in-out .4s 2 both; }
@keyframes orientation-hint-turn {
  0%, 15% { transform: rotate(0deg); }
  45%, 85% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .orientation-hint-device { animation: none; } }

.orientation-hint-copy { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; }
/* The heading always gets the full text width, including on the narrowest phone. */
.orientation-hint-copy strong { grid-column: 1 / -1; color: var(--gold); font-weight: 600; font-size: 14px; }
.orientation-hint-copy span { color: #c9bfa9; font-size: 13px; }

#btn-orientation-hint {
  grid-column: 2; grid-row: 2; min-width: 64px; min-height: 44px; padding: 8px 12px;
  border: 1px solid #6e6047; border-radius: 3px; outline: none;
  background: linear-gradient(135deg, #34392e, #202a25); color: #e8dcc5;
  box-shadow: inset 0 1px #dac99c16, inset 0 -2px #0004;
  font: 600 14px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: 0; text-transform: none;
  cursor: pointer; touch-action: manipulation;
}
#btn-orientation-hint:active { background: linear-gradient(135deg, #3d4234, #26312b); }
#btn-orientation-hint:hover:not(:disabled) { border-color: #c7ab76; }
#btn-orientation-hint:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
