/* tablr games · the shared home-screen look: near-black, cream type, one splash of colour at a time.
   Big, chunky, friendly type (think party-game lobby); the logo animates in; the brand intro overlay. */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --t-bg: #0a0a0f;
  --t-bg-2: #15151d;
  --t-ink: #f8f4ea;
  --t-ink-2: rgba(248, 244, 234, 0.66);
  --t-ink-3: rgba(248, 244, 234, 0.4);
  --t-line: rgba(248, 244, 234, 0.16);
  --t-spark: #ff5a4e; /* coral: the one splash on the home screen */
  --t-mint: #7ee0b2; /* a second splash, used sparingly */
  --t-felt: #2f6b4f; /* Buraco's own colour, for its tile */
  --t-lake: #1f5a7a; /* Dominoes' own colour, for its tile */
  --t-round: Outfit, Inter, system-ui, sans-serif; /* the display face: geometric and clean, like the wordmark */
  --t-font: Inter, system-ui, -apple-system, sans-serif;
  --t-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-snap: cubic-bezier(0.3, 1.5, 0.5, 1);
}

html,
body {
  margin: 0;
  padding: 0;
}
body.tablr {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  box-sizing: border-box;
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: var(--t-font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.tablr::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(248, 244, 234, 0.07), transparent 70%);
}
.tablr * {
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}

.t-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 30px;
}

/* ---------- Logo: the traced artwork, mounted by tablr.js and animated in group by group ---------- */
.t-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}
.t-logo {
  position: relative;
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  line-height: 0;
  text-decoration: none;
}
.t-logo.sm {
  max-width: 240px;
}
.t-logo {
  perspective: 900px;
}
.t-logo .tilt {
  position: relative;
  transition: transform 0.35s var(--t-out);
  transform-style: preserve-3d;
  will-change: transform;
}
/* The light sweep: a soft band of light glides across the cream shapes once they are in, and again now and then. */
.t-logo .shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    112deg,
    transparent 38%,
    rgba(255, 255, 255, 0.55) 47%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.55) 53%,
    transparent 62%
  );
  background-size: 260% 100%;
  background-repeat: no-repeat;
  -webkit-mask: url(/tablr-logo.svg) center / contain no-repeat;
  mask: url(/tablr-logo.svg) center / contain no-repeat;
}
.t-logo.in .shine {
  animation: lgShine 9s ease-in-out 1.3s infinite;
}
@keyframes lgShine {
  0% {
    opacity: 0;
    background-position: 130% 0;
  }
  2% {
    opacity: 1;
  }
  18% {
    opacity: 1;
    background-position: -30% 0;
  }
  20% {
    opacity: 0;
    background-position: -30% 0;
  }
  100% {
    opacity: 0;
    background-position: -30% 0;
  }
}
.t-logo svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55));
}
.t-logo svg path,
.t-logo svg g {
  transform-box: fill-box;
  transform-origin: center;
}
.t-logo .lg-table,
.t-logo .lg-dice,
.t-logo .lg-word,
.t-logo .lg-games {
  opacity: 0;
}
.t-logo.in .lg-table {
  animation: lgRise 0.7s var(--t-out) 0.05s both;
}
.t-logo.in .lg-dice {
  animation: lgDrop 0.9s var(--t-snap) 0.3s both;
}
.t-logo.in .g-dice {
  animation: lgHop 7s ease-in-out 3.5s infinite;
}
.t-logo.in .lg-word {
  animation: lgRise 0.7s var(--t-out) 0.4s both;
}
.t-logo.in .lg-games {
  animation: lgSlide 0.6s var(--t-out) 0.75s both;
}
@keyframes lgRise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* The die falls in from well above the table, whole, and lands in its opening. Heights are shares of the die's own. */
@keyframes lgDrop {
  0% {
    opacity: 0;
    transform: translateY(-90%) rotate(-14deg);
  }
  20% {
    opacity: 1;
  }
  55% {
    opacity: 1;
    transform: translateY(2%) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes lgSlide {
  from {
    opacity: 0;
    transform: translateX(-16px);
    letter-spacing: 1em;
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* Now and then the die hops clear out of the table, then settles back in. */
@keyframes lgHop {
  0%,
  9%,
  100% {
    transform: none;
  }
  3.5% {
    transform: translateY(-22%) rotate(-6deg);
  }
  6.5% {
    transform: translateY(1.5%) rotate(2deg);
  }
}

.t-tag {
  margin: 0;
  font-family: var(--t-round);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--t-ink);
  animation: tIn 0.6s var(--t-out) 0.9s both;
}
.t-tag em {
  font-style: normal;
  color: var(--t-spark);
}
.t-tag.sub {
  font-family: var(--t-font);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.45;
  color: var(--t-ink-2);
  animation-delay: 0.55s;
}

/* ---------- Options: big, chunky, one per row ---------- */
.t-opts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: tIn 0.6s var(--t-out) 1.05s both;
}
.t-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 108px;
  padding: 18px 20px;
  box-sizing: border-box;
  border-radius: 26px;
  border: 2px solid var(--t-line);
  background: var(--t-bg-2);
  color: var(--t-ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  transition:
    transform 140ms var(--t-out),
    border-color 140ms,
    box-shadow 140ms;
}
.t-opt .ic {
  flex: none;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(248, 244, 234, 0.09);
  color: var(--t-ink);
}
.t-opt .ic svg {
  width: 32px;
  height: 32px;
}
.t-opt span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.t-opt b {
  font-family: var(--t-round);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.t-opt i {
  font-style: normal;
  font-size: 16px;
  line-height: 1.4;
  color: var(--t-ink-2);
}
.t-opt::after {
  content: '';
  flex: none;
  margin-left: auto;
  width: 13px;
  height: 13px;
  border-right: 3px solid var(--t-ink-3);
  border-top: 3px solid var(--t-ink-3);
  transform: rotate(45deg);
}
.t-opt:hover,
.t-opt:focus-visible {
  border-color: rgba(248, 244, 234, 0.45);
  outline: none;
  transform: translateY(-2px);
}
.t-opt:active {
  transform: scale(0.985);
}
.t-opt.spark {
  background: var(--t-ink);
  color: var(--t-bg);
  border-color: var(--t-ink);
  box-shadow: 0 12px 36px rgba(255, 90, 78, 0.18);
}
.t-opt.spark .ic {
  background: var(--t-spark);
  color: var(--t-ink);
}
.t-opt.spark i {
  color: rgba(10, 10, 15, 0.68);
}
.t-opt.spark::after {
  border-color: var(--t-bg);
}
.t-opt.spark:hover,
.t-opt.spark:focus-visible {
  box-shadow:
    0 0 0 4px rgba(255, 90, 78, 0.35),
    0 12px 36px rgba(255, 90, 78, 0.25);
}

/* Game tiles (Host → pick a game) */
.t-game {
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  min-height: 150px;
}
.t-game .art {
  flex: none;
  width: 128px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #3a7d5c, var(--t-felt) 60%, #1f4a37);
  color: #f2d28b;
}
/* Dominoes' tile: its lake blue and sunset coral */
.t-game[data-game='dominoes'] .art {
  background: linear-gradient(160deg, #2a6c87, var(--t-lake) 60%, #164563);
  color: #ff9a6b;
}
.t-game .art svg {
  width: 62px;
  height: 68px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.t-game span {
  padding: 20px 0;
}
.t-game b {
  font-size: 36px;
}
.t-game .ppl {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-mint);
}
.t-game::after {
  margin-right: 22px;
  align-self: center;
}

/* ---------- Join form ---------- */
.t-join {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
  border-radius: 26px;
  border: 2px solid var(--t-line);
  background: var(--t-bg-2);
  animation: tIn 220ms var(--t-out) both;
}
.t-join label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t-ink-2);
}
.t-join form {
  display: flex;
  gap: 10px;
}
.t-join input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 18px;
  border: 2px solid var(--t-line);
  background: var(--t-bg);
  color: var(--t-ink);
  font: 700 30px var(--t-round);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  outline: none;
}
.t-join input::placeholder {
  color: var(--t-ink-3);
  letter-spacing: 0.18em;
}
.t-join input:focus {
  border-color: var(--t-spark);
}
.t-btn {
  border: 0;
  cursor: pointer;
  min-width: 120px;
  min-height: 64px;
  padding: 0 22px;
  border-radius: 18px;
  background: var(--t-ink);
  color: var(--t-bg);
  font: 700 22px var(--t-round);
}
.t-btn:active {
  transform: scale(0.97);
}
.t-btn:focus-visible {
  outline: 3px solid var(--t-spark);
  outline-offset: 2px;
}
.t-err {
  min-height: 1.3em;
  font-size: 16px;
  font-weight: 500;
  color: var(--t-spark);
}
.t-hint {
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
  color: var(--t-ink-3);
  animation: tIn 0.6s var(--t-out) 1.2s both;
}

.t-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  padding: 12px 20px 12px 14px;
  border-radius: 999px;
  border: 2px solid var(--t-line);
  color: var(--t-ink-2);
  font: 700 17px var(--t-round);
  text-decoration: none;
}
.t-back::before {
  content: '';
  width: 9px;
  height: 9px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
}
.t-h1 {
  margin: 0;
  font-family: var(--t-round);
  font-weight: 800;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-align: center;
  animation: tIn 0.6s var(--t-out) 0.4s both;
}
.t-h1 .dot {
  color: var(--t-spark);
}
.t-foot {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--t-ink-3);
  animation: tIn 0.6s var(--t-out) 1.3s both;
}

/* The language picker under the footer (langPickerHtml() from /i18n/dom.js, mounted by tablr.js): quiet text with a
   native select, the same look as .langpick in shared.css. */
.t-lang {
  display: flex;
  justify-content: center;
  margin-top: -14px;
  animation: tIn 0.6s var(--t-out) 1.3s both;
}
.t-lang .langpick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--t-ink-3);
  font: 500 14px/1 var(--t-font);
}
.t-lang select {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  color: var(--t-ink-2);
  font: inherit;
  padding: 4px 16px 4px 2px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 6px center,
    right 2px center;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.t-lang select option {
  color: #111;
}

/* ---------- The brand intro: black, the logo swells in on the beat, then it fades to the game ---------- */
.t-intro {
  --beat: 0.42s;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--t-bg);
  animation: tFade 0.25s ease both;
}
.t-intro .t-logo,
.t-intro .ring {
  transition: opacity 0.45s ease;
}
.t-intro.out .t-logo,
.t-intro.out .ring {
  opacity: 0 !important;
} /* the logo fades; the black stays until the game's screen takes over */
.t-intro .t-logo {
  width: min(78vw, 760px);
  max-width: none;
}
.t-intro .t-logo .lg-table,
.t-intro .t-logo .lg-dice,
.t-intro .t-logo .lg-word,
.t-intro .t-logo .lg-games {
  opacity: 1;
  animation: none;
}
.t-intro .t-logo svg {
  opacity: 0;
  animation: inSwell 1.5s cubic-bezier(0.16, 0.9, 0.25, 1) var(--beat) both;
  filter: drop-shadow(0 0 28px rgba(248, 244, 234, 0.22)) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6));
}
.t-intro .t-logo .shine {
  animation: inShine 1.6s ease-in-out calc(var(--beat) + 0.75s) both;
}
@keyframes inShine {
  0% {
    opacity: 0;
    background-position: 130% 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
    background-position: -30% 0;
  }
  100% {
    opacity: 0;
    background-position: -30% 0;
  }
}
.t-intro .ring {
  position: absolute;
  width: min(60vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--t-ink);
  opacity: 0;
  animation: inRing 1.4s cubic-bezier(0.1, 0.7, 0.3, 1) var(--beat) both;
  pointer-events: none;
}
.t-intro .ring.two {
  animation-delay: calc(var(--beat) + 0.16s);
  border-width: 1.5px;
}
.t-intro .lg-dice {
  animation: inDice 1.5s var(--t-snap) var(--beat) both !important;
}
@keyframes inSwell {
  0% {
    opacity: 0;
    transform: scale(0.62);
    filter: blur(10px) drop-shadow(0 0 0 rgba(248, 244, 234, 0));
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
    filter: blur(0) drop-shadow(0 0 28px rgba(248, 244, 234, 0.22)) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6));
  }
}
@keyframes inDice {
  0% {
    transform: translateY(-70%) rotate(-18deg);
  }
  60% {
    transform: translateY(2%) rotate(3deg);
  }
  100% {
    transform: none;
  }
}
@keyframes inRing {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  12% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}
@keyframes tFade {
  from {
    opacity: 0;
  }
}
@keyframes tIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 400px) {
  .t-opt b {
    font-size: 27px;
  }
  .t-game b {
    font-size: 31px;
  }
  .t-h1 {
    font-size: 46px;
  }
  .t-tag {
    font-size: 22px;
  }
  .t-game .art {
    width: 104px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .t-logo .lg-table,
  .t-logo .lg-dice,
  .t-logo .lg-word,
  .t-logo .lg-games {
    opacity: 1;
    animation: none !important;
  }
  .t-logo .shine,
  .t-logo.in .shine {
    animation: none;
    display: none;
  }
  .t-logo.in .g-dice {
    animation: none;
  }
  .t-logo .tilt {
    transition: none;
  }
  .t-tag,
  .t-opts,
  .t-hint,
  .t-h1,
  .t-foot,
  .t-lang,
  .t-join {
    animation: none;
  }
  .t-opt,
  .t-btn {
    transition: none;
  }
  .t-intro .t-logo svg {
    animation: tFade 0.6s ease 0.3s both;
  }
  .t-intro .ring {
    display: none;
  }
  .t-intro .lg-dice {
    animation: none !important;
  }
}
