/* Frame of every page: container, top line, docked navigation, menu, footer, layers.
   Moved from mockups/rnycasino.ch/b-fasnacht.html (top, dock); the rest in its language. */

.container { width: min(100% - 2 * var(--container-pad), var(--container)); margin-inline: auto; }
body { padding-bottom: 112px; overflow-x: clip; }
html { overflow-x: clip; }
.anchor { position: relative; top: -24px; display: block; height: 0; }
:target { scroll-margin-top: 24px; }

/* ── paper grain (from the mockup) ── */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

/* ── logo: image wordmark (assets/img/brand/), dark on paper, light on the ink footer ── */
.logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.logo__img { display: block; height: 36px; width: auto; transition: transform var(--dur-base) var(--spring); }
.logo:hover .logo__img { transform: rotate(-2deg); }
.logo--lg .logo__img { height: 46px; }

/* ── top line: logo · language · account · menu ── */
.topline { position: relative; z-index: var(--z-header); }
.topline__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.topline__r { display: flex; align-items: center; gap: 10px; }

.lang-switch { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); }
.lang-switch a { position: relative; display: grid; place-items: center; min-width: 36px; min-height: 32px; padding: 0 8px; border-radius: var(--radius-pill); font-weight: 700; font-size: .76rem; color: var(--color-muted); text-decoration: none; transition: background var(--dur-base), color var(--dur-base); }
.lang-switch a:hover { color: var(--color-text); background: var(--surface-3); }
.lang-switch a[aria-current] { background: var(--color-text); color: var(--color-bg); }
.lang-switch--lg a { font-size: .9rem; min-height: 40px; padding: 0 14px; flex: 1; }

.acct-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--color-text); color: var(--color-bg); font-weight: 700; text-decoration: none; transition: transform var(--dur-base) var(--spring); }
.acct-pill:hover { transform: translateY(-2px); }
.acct-pill .icon { width: 18px; height: 18px; color: var(--color-sun); }

.menu-btn, .icon-btn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--color-text); background: transparent; cursor: pointer; transition: background var(--dur-base), color var(--dur-base), transform var(--dur-base) var(--spring); }
.menu-btn:hover, .icon-btn:hover { background: var(--color-text); color: var(--color-bg); transform: rotate(-6deg); }

/* ── dock: navigation capsule fixed at the bottom (signature of the mockup) ── */
.dock {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: var(--z-dock);
  display: flex; align-items: center; gap: 4px; padding: 8px; max-width: calc(100% - 24px);
  background: var(--color-text); color: var(--color-bg); border-radius: var(--radius-pill); box-shadow: var(--shadow-dock);
  transition: transform var(--dur-slow) var(--ease), opacity var(--dur-slow);
}
.dock.is-tucked { transform: translate(-50%, 140%); }
.dock__a {
  display: flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: var(--radius-pill);
  font: 700 .9rem/1 var(--font-body); color: var(--color-ink-soft); background: none; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-base), color var(--dur-base);
}
.dock__a .icon { width: 19px; height: 19px; }
.dock__a:hover { color: var(--color-bg); background: rgb(244 239 230 / .1); }
.dock__a[aria-current], .dock__a.is-active { background: var(--color-sun); color: var(--color-text); }
.dock__sep { width: 1px; height: 26px; background: rgb(244 239 230 / .2); margin: 0 6px; }
.dock__cta { background: var(--color-brand-strong); color: #fff; }
.dock__cta:hover { background: var(--color-brand-hover); color: #fff; }

/* ── menu overlay ── */
.menu { position: absolute; inset: 0 0 0 auto; width: min(440px, 100%); display: flex; flex-direction: column; gap: 28px; padding: 22px 24px 40px; background: var(--color-bg); overflow-y: auto; transform: translateX(100%); transition: transform var(--dur-slow) var(--ease); }
.overlay.is-open .menu { transform: none; }
.menu__top { display: flex; justify-content: space-between; align-items: center; }
.menu__nav ul { display: grid; gap: 4px; }
.menu__nav > ul:first-child a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; font: 800 1.45rem/1.1 var(--font-display); letter-spacing: -.04em; text-decoration: none; border-bottom: 1px solid var(--color-border); transition: color var(--dur-base), padding var(--dur-base) var(--ease); }
.menu__nav > ul:first-child a:hover { color: var(--color-brand-strong); padding-left: 10px; }
.menu__nav > ul:first-child a .icon { width: 22px; height: 22px; color: var(--color-brand); }
.overlay.is-open .menu__nav > ul:first-child li { animation: menuIn var(--dur-slow) var(--ease) both; animation-delay: calc(var(--i) * 40ms + 80ms); }
@keyframes menuIn { from { opacity: 0; transform: translateX(24px); } }
.menu__pages { margin-top: 18px; grid-template-columns: 1fr 1fr; }
.menu__pages a { display: block; padding: 8px 0; font-weight: 600; color: var(--color-muted); text-decoration: none; }
.menu__pages a:hover, .menu__pages a[aria-current] { color: var(--color-text); text-decoration: underline; text-underline-offset: 4px; }
.menu__lang { display: grid; gap: 10px; }
.menu__lang > span { font-size: var(--fs-tiny); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--color-muted); }
.menu__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }

/* ── footer ── */
.foot { position: relative; z-index: 2; margin-top: var(--section-pad); padding: 72px 0 40px; background: var(--color-text); color: var(--color-bg); border-radius: 36px 36px 0 0; }
.foot a { color: inherit; }
.foot__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; padding-bottom: 40px; border-bottom: 1px solid rgb(244 239 230 / .14); }
.foot__rg { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; max-width: 34ch; color: rgb(244 239 230 / .78); font-size: var(--fs-small); }
.foot__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot__h { font: 800 .78rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--color-sun); margin-bottom: 16px; }
.foot__col ul { display: grid; gap: 6px; }
.foot__col a, .foot__linkbtn { position: relative; display: inline-block; padding: 3px 0; font-size: var(--fs-small); color: rgb(244 239 230 / .82); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; transition: color var(--dur-base); }
.foot__col a::after, .foot__linkbtn::after { content: ""; position: absolute; inset: 50% 0 auto 0; translate: 0 -50%; height: 100%; min-height: 24px; }
.foot__col a:hover, .foot__linkbtn:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot__data { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px; padding: 32px 0; border-bottom: 1px solid rgb(244 239 230 / .14); }
.foot__data dt { font-size: var(--fs-tiny); letter-spacing: .08em; text-transform: uppercase; color: rgb(244 239 230 / .6); }
.foot__data dd { margin: 4px 0 0; font-weight: 600; font-size: var(--fs-small); overflow-wrap: anywhere; }
.foot__pay { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; padding: 28px 0; }
.foot__pay .paychip { min-width: 0; }
.foot__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; font-size: var(--fs-tiny); color: rgb(244 239 230 / .6); }
.foot .lang-switch { background: rgb(244 239 230 / .08); box-shadow: none; }
.foot .lang-switch a { color: rgb(244 239 230 / .75); }
.foot .lang-switch a:hover { background: rgb(244 239 230 / .14); color: #fff; }
.foot .lang-switch a[aria-current] { background: var(--color-sun); color: var(--color-text); }

/* ── layers ── */
.overlay { position: fixed; inset: 0; z-index: var(--z-overlay); background: rgb(22 22 29 / .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--dur-slow) var(--ease); overflow-y: auto; }
.overlay.is-open { opacity: 1; }
.overlay--gate { z-index: var(--z-gate); display: grid; place-items: center; padding: 16px; background: rgb(244 239 230 / .82); backdrop-filter: blur(14px); }
.modal { position: relative; width: min(760px, calc(100% - 24px)); margin: 6vh auto; padding: 36px; background: var(--surface-1); border-radius: var(--radius-lg); box-shadow: var(--shadow-dock); overflow: hidden; transform: translateY(24px) scale(.98); transition: transform var(--dur-slow) var(--spring); }
.overlay.is-open .modal { transform: none; }
.modal--sm { width: min(480px, calc(100% - 24px)); }
.modal__x { position: absolute; top: 16px; right: 16px; z-index: 2; width: 42px; height: 42px; }
.modal__title { position: relative; font: 800 var(--fs-h3)/1.1 var(--font-display); letter-spacing: -.04em; padding-right: 48px; font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); }
.modal__lead { position: relative; color: var(--color-muted); margin: 8px 0 24px; }
.modal__foot { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); font-size: var(--fs-small); }
.modal__shape { position: absolute; top: -40px; right: -30px; width: 160px; height: 140px; background: var(--color-sun); clip-path: polygon(50% 0, 100% 100%, 0 100%); opacity: .5; }
.modal__shape--circ { width: 150px; height: 150px; clip-path: none; border-radius: 50%; background: var(--color-brand); opacity: .14; }

/* age gate */
.gate { position: relative; width: min(560px, 100%); padding: 44px 36px 30px; text-align: center; background: var(--surface-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-dock); overflow: hidden; }
.gate__shape { position: absolute; left: 50%; top: -120px; width: 320px; height: 240px; translate: -50% 0; background: var(--color-sun); clip-path: polygon(50% 0, 100% 100%, 0 100%); opacity: .35; }
.gate .badge18 { position: relative; margin: 0 auto 18px; }
.gate__title { position: relative; font: 800 clamp(1.5rem, 1rem + 2vw, 2.2rem)/1.05 var(--font-display); letter-spacing: -.045em; text-wrap: balance; }
.gate__text { position: relative; margin: 14px auto 26px; color: var(--color-muted); max-width: 44ch; font-size: var(--fs-small); }
.gate__acts { display: grid; gap: 10px; }
.gate__lang { position: relative; display: inline-flex; margin-top: 22px; }
.denied-bar { position: relative; z-index: 5; background: var(--color-warning-bg); border-bottom: 1px solid var(--color-border); font-size: var(--fs-small); }
.denied-bar__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }

/* cookie bar */
.cookiebar { position: fixed; left: 16px; right: 16px; bottom: 100px; z-index: calc(var(--z-dock) + 1); display: flex; justify-content: center; animation: cbIn var(--dur-slow) var(--spring) both .3s; }
@keyframes cbIn { from { opacity: 0; transform: translateY(30px); } }
.cookiebar__in { display: flex; align-items: center; gap: 16px; width: min(980px, 100%); padding: 14px 14px 14px 18px; background: var(--surface-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-dock); font-size: var(--fs-small); }
.cookiebar__in p { flex: 1; }
.cookiebar__in p a { font-weight: 700; }
.cookiebar__ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--color-sun); }
.cookiebar__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ck { display: grid; gap: 4px; }
.ck__row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.ck__row p { color: var(--color-muted); font-size: var(--fs-small); margin-top: 2px; }
.ck__always { font-size: var(--fs-tiny); font-weight: 700; color: var(--color-success); white-space: nowrap; }
.ck__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ck__link { margin-top: 10px; font-size: var(--fs-small); }

/* language suggestion */
.langsuggest { position: fixed; top: 16px; left: 50%; translate: -50% 0; z-index: calc(var(--z-dock) + 2); display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: max-content; max-width: calc(100% - 24px); padding: 10px 10px 10px 18px; background: var(--color-text); color: var(--color-bg); border-radius: var(--radius-pill); box-shadow: var(--shadow-dock); font-size: var(--fs-small); animation: lsIn var(--dur-slow) var(--spring) both; }
.langsuggest .linkbtn { color: rgb(244 239 230 / .75); }
@keyframes lsIn { from { opacity: 0; transform: translateY(-20px); } }

.toast { position: fixed; left: 50%; bottom: 104px; translate: -50% 0; z-index: var(--z-toast); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 12px 18px; border-radius: var(--radius-pill); background: var(--color-text); color: var(--color-bg); font-weight: 600; font-size: var(--fs-small); box-shadow: var(--shadow-dock); animation: lsIn var(--dur-base) var(--spring) both; }
.toast .icon { color: var(--color-sun); width: 18px; height: 18px; }

.to-top { position: fixed; right: 20px; bottom: 24px; z-index: var(--z-dock); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--color-sun); color: var(--color-text); box-shadow: var(--shadow-card); cursor: pointer; transition: transform var(--dur-base) var(--spring); }
.to-top:hover { transform: translateY(-3px); }

/* ── tablet ── */
@media (max-width: 1040px) {
  .foot__top { grid-template-columns: 1fr; }
  .foot__pay { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dock__a--wide span { display: none; }
}

/* ── phone: the dock becomes an icon tab bar ── */
@media (max-width: 760px) {
  body { padding-bottom: 96px; }
  .topline__in { padding-block: 14px; }
  .topline .topline__login { display: none; }   /* .btn (components.css, loaded later) would win at equal specificity */
  .topline .lang-switch a { min-width: 30px; padding: 0 4px; font-size: .7rem; }
  /* signed in, the balance needs the room: the language switch stays in the menu (ТЗ §8.1 allows either) */
  [data-authed] .topline .lang-switch { display: none; }
  .logo__img { height: 28px; }
  .logo--lg .logo__img { height: 38px; }
  .menu-btn { width: 42px; height: 42px; }
  .acct-pill { padding: 0 12px; min-height: 42px; font-size: .82rem; }
  .dock { left: 10px; right: 10px; bottom: 10px; transform: none; justify-content: space-between; gap: 0; padding: 6px; border-radius: 24px; }
  .dock.is-tucked { transform: translateY(140%); }
  .dock__a { flex: 1; flex-direction: column; gap: 3px; padding: 8px 2px; font-size: .64rem; border-radius: 18px; min-width: 0; }
  .dock__a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .dock__a--wide, .dock__sep { display: none; }
  .foot { border-radius: 24px 24px 0 0; padding-top: 52px; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__pay { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot__cols .foot__col:last-child { grid-column: 1 / -1; }
  .modal { padding: 26px 20px; margin: 12px auto; }
  .cookiebar { bottom: 88px; left: 8px; right: 8px; }
  .cookiebar__in { flex-direction: column; align-items: stretch; gap: 10px; }
  .cookiebar__ic { display: none; }
  .cookiebar__acts .btn { flex: 1; }
  .to-top { bottom: 96px; right: 12px; width: 42px; height: 42px; }
  .toast { bottom: 92px; }
}
@media (max-width: 389px) {
  .topline .lang-switch { padding: 2px; }
  .topline .lang-switch a { min-width: 26px; }
  .topline .logo__img { height: 22px; }
  .dock__a { font-size: .56rem; }
}
