/* =====================================================================
   SITE SHELL — gabdice.com wrapper
   Tokens and layout match the designed page (play-gabdice-page.html).
   Loaded BEFORE gabdice.css so the game styles keep priority.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --felt:       #0B3D2E;   /* page background */
  --felt-deep:  #072A20;   /* header, footer, game table */
  --ivory:      #F5EFE0;   /* text */
  --brass:      #C9A227;   /* links, borders, buttons */
  --dice-red:   #B3261E;   /* spare accent */
  --serif: Georgia, 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --wide: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--felt);
  color: var(--ivory);
  font-family: var(--sans);
  line-height: 1.65;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
a { color: var(--brass); }
a:hover { color: var(--ivory); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: 1.5rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--brass); color: var(--felt-deep); padding: .5rem 1rem; z-index: 200; }
.skip:focus { left: 0; }

/* ---------- Header (sticky) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--felt-deep);
  border-bottom: 3px solid var(--brass);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: .9rem;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--ivory);
  text-decoration: none;
}
/* The wordmark artwork carries the name, so the header no longer sets type for
   it. Sized by width; height follows the file's aspect ratio. */
.brand-logo {
  display: block;
  width: 150px;
  height: auto;
}
.brand:hover { color: var(--ivory); }
.nav { display: flex; align-items: center; gap: 1.5rem; }
#site-menu { display: flex; align-items: center; gap: 1.5rem; }
.nav a { color: var(--ivory); text-decoration: none; font-size: .95rem; }
#site-menu a:hover { color: var(--brass); }

/* Account renders as the word "Account" (not a person icon) with a
   bronze-trimmed dropdown of the gabdice.com account pages. Shown only for
   signed-in users; guests get "Sign in" instead. */
.gd-account { position: relative; }
.gd-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--ivory);
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}
.gd-account-toggle:hover,
.gd-account-toggle[aria-expanded="true"] { color: var(--brass); }
.gd-account-menu {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 210px;
  flex-direction: column;
  background: var(--felt-deep);
  border: 2px solid var(--brass);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  padding: .5rem 0;
  z-index: 120;
}
.gd-account.open .gd-account-menu { display: flex; }
.gd-account-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem 1.1rem;
  color: var(--ivory);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.gd-account-menu a:hover { background: rgba(201, 162, 39, .16); color: var(--brass); }

/* The Customize / Reset / Sign out duplicates inside the menu only apply on
   phones, where the header versions are relocated into the dropdown. */
.menu-mobile-only { display: none; }

.btn {
  display: inline-block;
  background: var(--brass);
  color: var(--felt-deep);
  font-family: var(--serif);
  font-weight: 700;
  text-decoration: none;
  padding: .7rem 1.5rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}
.btn:hover { background: var(--ivory); color: var(--felt-deep); }

/* ---------- Page intro ---------- */
main { flex: 1; padding-block: 3rem 4rem; }
.intro { max-width: 46rem; margin-bottom: 2rem; }
.intro h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.intro p { margin: .75rem 0 0; font-size: 1.1rem; }

/* ---------- Game table ----------
   The game is a responsive HTML block, so the table grows with content
   instead of clipping it behind an absolutely positioned mount. */
.table {
  position: relative;
  border: 2px solid var(--brass);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 40%, #0F4A38 0%, var(--felt-deep) 75%);
  padding: clamp(.5rem, 1.5vw, 1.25rem);
  overflow: hidden;
}
#gabdice-game { position: relative; }
#gabdice-game iframe,
#gabdice-game canvas { display: block; width: 100%; height: 100%; border: 0; }

/* Game sits on felt — neutralize the shell's light-theme text defaults. */
#gabdice-game .game-frame { color: var(--ink, #17223b); }
#gabdice-game .game-title { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }

/* Placeholder (only shown if #gabdice-game is empty) */
.placeholder {
  display: grid; place-content: center; gap: .5rem;
  text-align: center; padding: 4rem 2rem; min-height: 380px;
}
.placeholder h2 { font-size: 1.75rem; color: var(--brass); }
.placeholder p { margin: 0; max-width: 32rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--felt-deep);
  color: var(--ivory);
  border-top: 3px solid var(--brass);
  padding-block: 3.5rem 2rem;
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
.site-footer h3 { font-size: 1.5rem; }
.site-footer h4 { color: var(--brass); font-size: 1.15rem; margin-bottom: .75rem; }
.site-footer p { margin: .5rem 0 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; line-height: 1.9; }
.site-footer a { color: var(--ivory); }
.site-footer a:hover { color: var(--brass); }
.site-footer hr { border: 0; height: 2px; background: var(--brass); margin: 2.5rem 0 1.25rem; }
.copyright { text-align: center; font-size: .9rem; margin: 0; }

/* ---------- Nav toggle (built here, revealed only on phones) ---------- */
.nav-toggle {
  display: none;                /* desktop: the inline nav is used instead */
  min-width: 72px;
  min-height: 44px;
  padding: .55rem 1.1rem;
  background: transparent;
  border: 2px solid var(--brass);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: var(--brass); color: var(--felt-deep); }

/* ---------- Small screens ----------
   Matches the compact board breakpoint so the header nav stays in its
   dropdown (hamburger) form across the whole <1000px range. */
@media (max-width: 999px) {
  .nav { width: auto; justify-content: flex-end; gap: .5rem; align-items: center; }

  /* With Customize and the game buttons relocated into the dropdown, the
     header row holds only the brand block and the toggle. */
  .site-header .wrap { padding-block: .55rem; padding-inline: 1rem; column-gap: .75rem; }

  /* Slightly smaller wordmark so the toggle keeps clear of it. */
  .brand-logo { width: 132px; }

  /* Customize and the two game buttons live in the dropdown on phones. */
  .nav .btn { display: none; }
  .menu-mobile-only { display: block; }

  .nav-toggle { display: inline-flex; }

  #site-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem 0;
    margin: 0;
    background: var(--felt-deep);
    border: 2px solid var(--brass);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
    z-index: 120;
  }
  #site-menu.is-open { display: flex; }
  /* Catch-all: whatever ends up in the menu — links, or button-shaped items
     like Reset game / Sign out — gets the same comfortable touch target. */
  #site-menu a,
  #site-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: .5rem 1.1rem;
    box-sizing: border-box;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ivory);
    background: transparent;
    border: 0;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  #site-menu a:hover,
  #site-menu button:hover { background: rgba(201, 162, 39, .16); color: var(--brass); }

  /* In the mobile menu, Account's toggle is hidden and its submenu links are
     flattened into the menu as plain rows. */
  #site-menu .gd-account { display: flex; flex-direction: column; width: 100%; }
  #site-menu .gd-account-toggle { display: none; }
  #site-menu .gd-account-menu {
    display: flex;
    position: static;
    width: 100%;
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }
  /* Indent the account submenu links so they read as nested under Account. */
  #site-menu .gd-account-menu a { padding-left: 2.1rem; }
}

/* ---------- Phones only: footer stacks, table padding tightens ---------- */
@media (max-width: 700px) {
  .footer-cols { grid-template-columns: 1fr; gap: 1.75rem; }
  main { padding-block: 1.25rem 2rem; }

  /* Trim the felt table's padding so the game gets the width back. */
  .table { padding: .5rem; border-radius: 14px; }
}
