/* Existing Turnmori wordmark role. Only the five explicitly tagged public games. */
body[data-tm-brand-game] :is(a.wordmark,header>a.brand,header>a#home,.home-link .brand){
 font-family:Pretendard,sans-serif;
 font-size:25px;font-weight:700;line-height:1.2;letter-spacing:-.04em;
}
body[data-tm-brand-game="promotion-clicker"] .home-link .brand{display:inline;flex:none}
@media(max-width:600px){
 body[data-tm-brand-game] :is(a.wordmark,header>a.brand,header>a#home,.home-link .brand){font-size:21px}
 body[data-tm-brand-game="promotion-clicker"] .home-title{flex-direction:column;align-items:flex-start;gap:0}
 body[data-tm-brand-game="promotion-clicker"] header>div{min-width:0}
}

/* Shared chrome for the nine current selectors. Keep each game's home handler. */

body[data-tm-selector-ui] {
  --tm-selector-ui: Pretendard,sans-serif;
  font-family: var(--tm-selector-ui);
}
body[data-tm-selector-ui] :is(button, input, textarea, select, summary) {
  font-family: var(--tm-selector-ui) !important;
}
body[data-tm-selector-ui] :is(h1, h2) {
  font-family:Gaegu,Pretendard,sans-serif;
  font-weight: 700;
}
body[data-tm-selector-ui] header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  height: auto;
  padding-block: 5px;
  border-bottom: 1px solid #d7c8b3;
  background: transparent;
}
body[data-tm-selector-ui] header > :is(a.wordmark, a.brand, a#home, a#homeLink) {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-width: 96px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  color: #453025;
  font: 700 30px/1.2 Gaegu,Pretendard,sans-serif;
  letter-spacing: 0;
  text-decoration: none;
}
body[data-tm-selector-ui] header > a:hover { color: #80543d; }
body[data-tm-selector-ui] header > a:focus-visible {
  outline: 3px solid #625074;
  outline-offset: 2px;
  border-radius: 4px;
}
body[data-tm-selector-ui] .festival-menu summary {
  width: auto;
  min-width: 44px;
  padding: 8px 10px;
  color: #453025;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid #d7c8b3;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
body[data-tm-selector-ui] .festival-menu summary:hover,
body[data-tm-selector-ui] .festival-menu[open] summary { background: #fbf4e6; }
@media (max-width: 400px) {
  body[data-tm-selector-ui] header .nav { gap: 4px; }
  body[data-tm-selector-ui] header .nav a { font-size: 12px; }
  body[data-tm-selector-ui] .festival-menu summary { padding-inline: 7px; font-size: 13px; }
}
/* Keep translated controls on one compact row at narrow phone widths. */
body[data-tm-selector-ui] header button { min-width: 44px; }
@media (max-width: 380px) {
  body[data-tm-selector-ui] .header-controls {
    flex-wrap: nowrap;
    min-width: 0;
    max-width: none;
  }
  body[data-tm-selector-ui] #soundToggleBtn {
    flex: 1;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
  }
  body[data-tm-selector-ui] #soundToggleBtn span { white-space: normal; }
  body[data-tm-selector-ui] .header-actions > [data-t="prototype"] { display: none; }
  body[data-tm-selector-ui] .header-actions button { line-height: 1.2; }
}

/* Restart is an explicit, reversible choice until the user confirms. */
.tm-restart-dialog{box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:24px;border:2px solid #453025;border-radius:18px;background:#f6eedf;color:#453025;box-shadow:0 12px 32px #45302533;overflow:auto}
.tm-restart-dialog::backdrop{background:#45302570}
.tm-restart-dialog h2{margin:0 0 12px;font-family:Gaegu,Pretendard,sans-serif;font-size:30px;line-height:1.2}
.tm-restart-dialog p{margin:0 0 24px;font-size:16px;line-height:1.6;overflow-wrap:anywhere}
.tm-restart-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:12px}
.tm-restart-actions button,.tm-restart-button{min-height:44px;padding:10px 16px;border:1px solid #453025;border-radius:12px;font:inherit;line-height:1.4;color:#453025;background:#f6eedf;cursor:pointer}
.tm-restart-actions button[value="restart"],.tm-restart-button{background:#c8d8aa}
.tm-restart-actions button:hover,.tm-restart-button:hover{filter:brightness(.96)}
.tm-restart-actions button:focus-visible,.tm-restart-button:focus-visible{outline:3px solid #453025;outline-offset:3px}
.tm-restart-button:disabled{opacity:.5;cursor:default}
.tm-restart-button[hidden]{display:none}
.tm-restart-hold *, .tm-restart-hold *::before, .tm-restart-hold *::after{animation-play-state:paused!important}
