:root { --ild-chrome-height: 52px; }

/* Keep the selected difficulty palette independent of generated utilities. */
button.ild-difficulty-medium {
  background: #b64908 !important;
  color: #fff !important;
  box-shadow: 0 10px 0 #77320a !important;
}
button.ild-difficulty-medium:active { box-shadow: none !important; }

[data-ild-game-active] .ild-game-chrome,
body.ild-game-has-chrome[data-mode]:not([data-mode="home"]) > .ild-game-chrome { display: none !important; }

.ild-game-chrome {
  position: relative;
  z-index: 100;
  box-sizing: border-box;
  block-size: var(--ild-chrome-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-inline: clamp(.45rem, 2vw, 1.2rem);
  background: #eff4fa;
  border-bottom: 1px solid #bdcadd;
  color: #0f223b;
  font: 700 .95rem/1.1 ui-rounded, Nunito, system-ui, sans-serif;
}
[data-ild-chrome-theme="dark"] .ild-game-chrome {
  background: #080e15;
  border-color: #283747;
  color: #e8f3ff;
}
.ild-game-chrome nav, .ild-chrome-actions {
  display: flex;
  align-items: center;
  gap: clamp(.25rem, .85vw, .75rem);
}
.ild-game-chrome nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 35px;
  box-sizing: border-box;
  padding: .22rem clamp(.45rem, 1.4vw, 1.1rem);
  border: 1px solid #16bbed;
  border-radius: 100px;
  background: linear-gradient(180deg, #09b5e4, #007cae 54%, #005382);
  color: #fff;
  text-decoration: none;
  text-align: center;
  text-shadow: 0 1px 2px #002c4a;
  box-shadow: inset 0 1px #ffffff42, 0 2px 7px #0076aa40;
}
.ild-game-chrome nav a:hover { filter: brightness(1.14); }
.ild-chrome-divider {
  display: grid;
  place-items: center;
  inline-size: 1.4rem;
  block-size: 1.4rem;
  flex: none;
  border-radius: 50%;
  background: #cde9f6;
  color: #005581;
}
[data-ild-chrome-theme="dark"] .ild-chrome-divider {
  background: #07314a;
  color: #63d6ff;
}
.ild-chrome-actions { flex: none; }
.ild-chrome-actions button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  inline-size: 38px;
  block-size: 38px;
  min-block-size: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: #dbe4ef;
  color: #182a43;
  box-shadow: 0 2px 0 #b5c3d5;
}
.ild-chrome-actions button[hidden] { display: none; }
.ild-chrome-actions svg { inline-size: 21px; block-size: 21px; }
.ild-chrome-actions .ild-chrome-power { background: #ffe2e2; color: #b81d25; box-shadow: 0 2px 0 #f69a9d; }
[data-ild-chrome-theme="dark"] .ild-chrome-actions button { background: #233348; color: #e5f1ff; box-shadow: 0 2px 0 #101a2b; }
[data-ild-chrome-theme="dark"] .ild-chrome-actions .ild-chrome-power { background: #49232b; color: #ffb3b6; box-shadow: 0 2px 0 #7d363e; }
.ild-chrome-actions button:hover { filter: brightness(1.13); }
.ild-game-chrome :is(a, button):focus-visible { outline: 3px solid #008ac4; outline-offset: 2px; }
.ild-chrome-preview { font-size: .78rem; font-weight: 600; white-space: nowrap; }

:root:not([data-ild-game-active]) .ild-game-has-chrome :is(#root, #game, #app) {
  --ild-game-height: calc(100vh - var(--ild-chrome-height));
  --ild-game-height: calc(100dvh - var(--ild-chrome-height));
  min-height: 0;
}
:root:not([data-ild-game-active]) .ild-game-has-chrome #game { min-height: var(--ild-game-height); }
:root:not([data-ild-game-active]) .ild-game-has-chrome #game[data-game="kesir-mutfagi"] { height: var(--ild-game-height); }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root {
  height: var(--ild-game-height) !important;
  max-height: var(--ild-game-height) !important;
}
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .h-screen { height: var(--ild-game-height) !important; }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root :is(.min-h-screen, .ild-select-screen) { min-height: var(--ild-game-height) !important; }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .ild-select-screen { max-height: var(--ild-game-height); }
.ild-game-has-chrome #root button[title="Çıkış Yap"],
.ild-game-has-chrome #root [data-ild-legacy-power],
.ild-game-in-portal #root button[title="Çıkış Yap"] { display: none !important; }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .fixed.inset-0 { top: var(--ild-chrome-height); }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .fixed.top-0 { top: var(--ild-chrome-height); }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .fixed.top-3 { top: calc(var(--ild-chrome-height) + .75rem); }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .fixed.top-4 { top: calc(var(--ild-chrome-height) + 1rem); }

@media (max-width: 540px) {
  .ild-game-chrome { font-size: .78rem; }
  .ild-chrome-preview { font-size: .65rem; }
  .ild-chrome-divider { inline-size: 1rem; block-size: 1rem; }
}
@media (max-width: 375px) {
  .ild-chrome-divider { display: none; }
  .ild-chrome-preview { white-space: normal; max-inline-size: 4.5rem; text-align: center; }
}
@media (max-height: 500px) and (orientation: landscape) {
  :root { --ild-chrome-height: 42px; }
  .ild-game-chrome nav a { min-block-size: 30px; }
  .ild-chrome-actions button { inline-size: 34px; block-size: 34px; }
}

:root:not([data-ild-game-active]) .ild-game-has-chrome #root .bg-screen { height: var(--ild-game-height); min-height: 0; overflow-y: auto; }
:root:not([data-ild-game-active]) .ild-game-has-chrome #root .app { height: var(--ild-game-height); }
:root:not([data-ild-game-active]) .ild-game-has-chrome[data-mode="home"] #app { height: auto; min-height: var(--ild-game-height); }
@media print {
  .ild-game-chrome { display: none; }
}
