/* ============================================================
   MONOPOLLY — $MONOPO / $LLY
   ============================================================ */

:root {
  color-scheme: light;

  /* board palette */
  --felt:        #c8e6d0;
  --felt-dark:   #b3d9bd;
  --tile:        #fbfbf3;
  --ink:         #111111;
  --line:        #111111;

  /* property colours */
  --brown:  #955436;
  --lblue:  #aae0fa;
  --pink:   #d93a96;
  --orange: #f7941d;
  --red:    #ed1b24;
  --yellow: #fef200;
  --green:  #1fb25a;
  --blue:   #0072bb;

  /* board sizing: --u is one small tile width, board = 12.2u */
  --board: min(92vw, 86vh, 900px);
  --u: calc(var(--board) / 12.2);

  --font-head: 'Anton', 'Arial Black', Impact, sans-serif;
  --font-board: 'Kanit', 'Trebuchet MS', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, #e9f6ec 0%, #cfe6d6 45%, #a8cdb4 100%);
  color: var(--ink);
  font-family: var(--font-board);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

/* ---------------- top bar ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(14px, 4vw, 40px);
  border-bottom: 3px solid var(--ink);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  background: var(--red); color: #fff;
  font-family: var(--font-head); font-size: 22px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.brand-text { font-family: var(--font-head); font-size: clamp(18px, 3vw, 26px); letter-spacing: .04em; }
.ticker-pill {
  font-weight: 800; font-size: clamp(12px, 2.4vw, 15px);
  background: var(--yellow); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 6px 12px; white-space: nowrap;
}
.ticker-pill span { opacity: .55; }

/* ============================================================
   STAGE — board in the middle, buttons all around it
   ============================================================ */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    ".    top    ."
    "left board  right"
    ".    bottom .";
  align-items: center; justify-items: center;
  gap: clamp(12px, 2vw, 26px);
  padding: clamp(18px, 3vw, 34px) clamp(10px, 2vw, 28px) clamp(26px, 4vw, 46px);
}
.slot--top    { grid-area: top; }
.slot--left   { grid-area: left; justify-self: end; }
.slot--right  { grid-area: right; justify-self: start; }
.slot--bottom { grid-area: bottom; }
.slot--board  { grid-area: board; }

/* ---------------- the big surrounding buttons ---------------- */
.bigbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: clamp(180px, 20vw, 250px);
  padding: 14px 20px;
  text-align: center; text-decoration: none;
  color: var(--ink); background: var(--tile);
  font-family: var(--font-board);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.bigbtn:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--ink); }
.bigbtn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.bigbtn:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

.bigbtn__kicker { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; opacity: .65; }
.bigbtn__label  { font-family: var(--font-head); font-size: clamp(17px, 2.2vw, 23px); letter-spacing: .03em; line-height: 1.1; }
.bigbtn__sub    { font-size: 11.5px; font-weight: 600; opacity: .7; }
.bigbtn__icon   { display: grid; place-items: center; margin-bottom: 2px; }

.bigbtn--buy   { background: var(--green); color: #fff; }
.bigbtn--buy .bigbtn__kicker,
.bigbtn--buy .bigbtn__sub { opacity: .9; color: #eafff1; }
.bigbtn--buy:hover { background: #18c261; }

.bigbtn--x     { background: #111; color: #fff; }
.bigbtn--x .bigbtn__sub { color: #cfcfcf; opacity: .9; }

.bigbtn--chart { background: var(--yellow); }
.bigbtn--ca    { background: #fff; max-width: min(92vw, 640px); }

.ca-text {
  font-family: 'Kanit', monospace;
  font-weight: 800;
  font-size: clamp(12px, 2.1vw, 17px);
  letter-spacing: .01em;
  word-break: break-all;
  max-width: 100%;
}
.bigbtn--ca.copied { background: var(--green); color: #fff; }

/* ============================================================
   THE BOARD
   ============================================================ */
.board-scroll {
  max-width: 100%;
  padding: 2px 2px 14px;
  -webkit-overflow-scrolling: touch;
}
.board {
  width: var(--board); height: var(--board);
  display: grid;
  grid-template-columns: calc(1.6 * var(--u)) repeat(9, var(--u)) calc(1.6 * var(--u));
  grid-template-rows:    calc(1.6 * var(--u)) repeat(9, var(--u)) calc(1.6 * var(--u));
  background: var(--felt);
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, .35);
}

/* ---- individual tiles ---- */
.tile {
  position: relative;
  border: 1px solid var(--line);
  background: var(--tile);
  overflow: hidden;
  padding: 0;
  font-family: var(--font-board);
  color: var(--ink);
  cursor: pointer;
  font-size: calc(var(--u) * .152);
  transition: filter .12s ease;
}
.tile:hover  { filter: brightness(.93); }
.tile:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; z-index: 4; }

.face {
  position: absolute; top: 50%; left: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
}
/* rotated sides: pre-rotation the face is 1u wide, 1.6u tall */
.tile--left  .face,
.tile--right .face { width: var(--u); height: calc(1.6 * var(--u)); flex-direction: column-reverse; }
.tile--left  .face { transform: translate(-50%, -50%) rotate(-90deg); }
.tile--right .face { transform: translate(-50%, -50%) rotate(90deg); }
.tile--top   .face { transform: translate(-50%, -50%) rotate(180deg); }

.bar {
  width: 100%; height: 22%;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.tile--left .bar, .tile--right .bar { border-bottom: none; border-top: 1px solid var(--line); }

.name {
  font-weight: 600;
  line-height: 1.02;
  padding: 6% 5% 0;
  text-transform: uppercase;
  letter-spacing: -.01em;
  flex: 1 1 auto;
  display: flex; align-items: flex-start; justify-content: center;
}
.tile--left .name, .tile--right .name { align-items: flex-end; padding: 0 5% 6%; }
.price { font-size: .82em; font-weight: 600; padding: 0 4% 5%; flex: none; }

.glyph { font-size: 2.1em; line-height: 1; flex: 1 1 auto; display: grid; place-items: center; }
.tile--chance .glyph  { color: var(--red); font-family: var(--font-head); }
.tile--cc .glyph      { color: #1a4fa0; }

/* ---- corners ---- */
.tile--corner { background: var(--tile); }
.tile--corner .face { transform: translate(-50%, -50%); flex-direction: column; justify-content: center; gap: 2%; padding: 6%; }
.corner-txt { font-family: var(--font-head); font-size: 1.05em; line-height: 1; letter-spacing: .02em; }
.corner-sub { font-size: .78em; font-weight: 600; line-height: 1.05; }
.corner-glyph { font-size: 2.2em; line-height: 1; }
.tile--go .face { transform: translate(-50%, -50%) rotate(-45deg); }
.tile--go .corner-txt { font-size: 1.9em; color: var(--red); }
.tile--gotojail .face  { transform: translate(-50%, -50%) rotate(45deg); }
.tile--freeparking .face { transform: translate(-50%, -50%) rotate(-45deg); }
.tile--jail .face { transform: translate(-50%, -50%); }
.jail-box {
  position: relative;
  width: 56%; aspect-ratio: 1; border: 1px solid var(--line);
  background: var(--orange);
  display: grid; place-items: center;
  overflow: hidden;
}
.jail-box span { font-size: 1.5em; }
.jail-box .bars {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--ink) 0 7%, transparent 7% 26%);
}
.jail-top { font-size: .95em; }

/* GO corner arrow */
.go-arrow {
  position: absolute; left: 10%; bottom: 9%;
  width: 52%; height: 14%;
  background: var(--red);
  clip-path: polygon(0% 50%, 34% 0%, 34% 28%, 100% 28%, 100% 72%, 34% 72%, 34% 100%);
}

/* ---- player token ---- */
.token {
  position: absolute; inset: auto 0 6% 0; margin: 0 auto;
  width: 46%; aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: calc(var(--u) * .42);
  z-index: 6; pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
  animation: pop .25s ease;
}
@keyframes pop { from { transform: translateY(-40%) scale(1.25); } to { transform: none; } }

/* ---- board centre ---- */
.center {
  grid-column: 2 / 11; grid-row: 2 / 11;
  position: relative;
  background: var(--felt);
}
.logo-wrap {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-38deg);
  white-space: nowrap;
}
.logo {
  display: inline-block;
  background: var(--red); color: #fff;
  font-family: var(--font-head);
  font-size: calc(var(--u) * .86);
  letter-spacing: .02em;
  padding: .16em .5em .22em;
  border: calc(var(--u) * .07) solid #fff;
  border-radius: calc(var(--u) * .14);
  box-shadow: 0 calc(var(--u) * .06) 0 rgba(0,0,0,.25);
}
.logo-sub {
  display: block; text-align: center;
  margin-top: calc(var(--u) * .16);
  font-weight: 800; font-size: calc(var(--u) * .26);
  letter-spacing: .16em;
}

.diamond {
  position: absolute; width: 34%; aspect-ratio: 1;
  border: calc(var(--u) * .045) dotted var(--ink);
  transform: rotate(45deg);
  display: grid; place-items: center;
}
.diamond--cc { left: 6%; top: 6%; }
.diamond--chance { right: 6%; bottom: 6%; }
.diamond span {
  transform: rotate(-45deg);
  font-family: var(--font-head);
  font-size: calc(var(--u) * .3);
  line-height: 1.05; text-align: center;
  letter-spacing: .02em;
}

/* dice control inside the centre */
.roll {
  position: absolute; left: 50%; bottom: 5%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: calc(var(--u) * .16);
  background: transparent;
}
.roll__btn {
  font-family: var(--font-head);
  font-size: calc(var(--u) * .3);
  letter-spacing: .06em;
  padding: calc(var(--u) * .12) calc(var(--u) * .3);
  background: #fff; color: var(--ink);
  border: calc(var(--u) * .045) solid var(--ink);
  box-shadow: calc(var(--u) * .08) calc(var(--u) * .08) 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.roll__btn:hover { background: var(--yellow); }
.roll__btn:disabled { opacity: .55; cursor: wait; }
.die {
  width: calc(var(--u) * .58); height: calc(var(--u) * .58);
  background: #fff; border: calc(var(--u) * .04) solid var(--ink);
  border-radius: calc(var(--u) * .1);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: calc(var(--u) * .07);
  gap: calc(var(--u) * .01);
}
.die span { display: grid; place-items: center; }
.die i { display: block; width: 74%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.roll__msg {
  position: absolute; left: 50%; bottom: calc(100% + var(--u) * .12);
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 800; font-size: calc(var(--u) * .22);
  background: #fff; border: 1px solid var(--ink);
  padding: calc(var(--u) * .05) calc(var(--u) * .16);
}

/* ============================================================
   PANELS BELOW THE BOARD
   ============================================================ */
.panel {
  padding: clamp(28px, 5vw, 60px) clamp(16px, 5vw, 60px);
  border-top: 3px solid var(--ink);
  background: #fff;
}
.panel--felt { background: var(--felt); }
.panel__title {
  font-family: var(--font-head);
  font-size: clamp(26px, 5vw, 44px);
  letter-spacing: .04em;
  margin: 0 0 6px;
  text-align: center;
}
.panel__lead { text-align: center; margin: 0 0 26px; font-weight: 600; opacity: .7; }

.deeds { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 1080px; margin: 0 auto; }
.deed { background: var(--tile); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.deed__head {
  font-family: var(--font-head); font-size: 20px; letter-spacing: .06em;
  padding: 12px; text-align: center; color: #fff;
  border-bottom: 3px solid var(--ink);
}
.deed--blue  .deed__head { background: var(--blue); }
.deed--red   .deed__head { background: var(--red); }
.deed--green .deed__head { background: var(--green); }
.deed__body { padding: 18px 20px 22px; }
.deed__big { font-family: var(--font-head); font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 14px; text-align: center; }
.deed__body ul { list-style: none; margin: 0 0 14px; padding: 0; }
.deed__body li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(0,0,0,.28); font-size: 14px; }
.deed__body li span { opacity: .7; font-weight: 600; }
.deed__body li b { text-align: right; }
.deed__note { margin: 0; font-size: 13px; font-weight: 600; opacity: .65; text-align: center; }

.steps { max-width: 900px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.steps li { background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.steps b { font-family: var(--font-head); font-size: 17px; letter-spacing: .03em; }
.steps span { font-size: 14px; opacity: .78; }

.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { border: 3px solid var(--ink); background: var(--tile); box-shadow: 5px 5px 0 var(--ink); }
.faq summary { cursor: pointer; padding: 14px 16px; font-family: var(--font-head); font-size: 17px; letter-spacing: .02em; }
.faq details[open] summary { border-bottom: 2px solid var(--ink); }
.faq p { margin: 0; padding: 14px 16px; font-size: 14.5px; line-height: 1.6; }

/* ---------------- footer ---------------- */
.foot { background: var(--ink); color: #fff; padding: 30px clamp(16px, 5vw, 60px) 40px; text-align: center; }
.foot__row { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center; margin-bottom: 18px; }
.foot__row a { color: #fff; text-decoration: none; font-family: var(--font-head); letter-spacing: .06em; border-bottom: 3px solid var(--red); padding-bottom: 2px; }
.foot__row a:hover { color: var(--yellow); }
.foot__fine { max-width: 720px; margin: 0 auto; font-size: 12px; line-height: 1.7; opacity: .6; }

/* ============================================================
   MODAL — title deed / chance card
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal__card {
  position: relative;
  width: min(94vw, 400px);
  background: var(--tile);
  border: 4px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(0,0,0,.5);
  padding: 22px 22px 24px;
  animation: cardin .18s ease;
}
@keyframes cardin { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__x {
  position: absolute; top: 6px; right: 10px;
  background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--ink);
}
.modal__bar { height: 42px; border: 3px solid var(--ink); margin-bottom: 14px; background: var(--felt); }
.modal__kicker { margin: 0; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; opacity: .6; }
.modal__title { margin: 4px 0 14px; text-align: center; font-family: var(--font-head); font-size: clamp(21px, 5vw, 28px); letter-spacing: .02em; line-height: 1.1; }
.modal__body { font-size: 14px; line-height: 1.6; }
.modal__body ul { list-style: none; margin: 0 0 14px; padding: 0; }
.modal__body li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,.25); }
.modal__body li span { opacity: .7; font-weight: 600; }
.modal__body p { margin: 12px 0 0; font-weight: 600; opacity: .8; text-align: center; }
.modal__cta {
  display: block; margin-top: 18px; text-align: center; text-decoration: none;
  font-family: var(--font-head); font-size: 18px; letter-spacing: .04em;
  background: var(--green); color: #fff;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  padding: 11px;
}
.modal__cta:hover { background: #18c261; }

/* ============================================================
   RESPONSIVE — buttons wrap around to a single column
   ============================================================ */
@media (max-width: 1080px) {
  :root { --board: min(94vw, 82vh, 760px); }
  .stage {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "board"
      "left"
      "right"
      "bottom";
  }
  .slot--left, .slot--right { justify-self: center; }
  .slot--left, .slot--right, .slot--top { width: min(92vw, 420px); }
  .bigbtn { width: 100%; }
}

@media (max-width: 620px) {
  :root { --board: 96vw; }           /* whole board always fits the screen */
  .tile { font-size: calc(var(--u) * .17); }
  .price { display: none; }          /* too small to read — the tile card shows it */
  .board { box-shadow: 6px 6px 0 rgba(0, 0, 0, .3); }
  .stage { padding-left: 8px; padding-right: 8px; }
  .roll__btn { font-size: calc(var(--u) * .36); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
