/* Azulejos table look. Solid colors only: nothing is see-through. Sizes come from the table root:
   --tile (board tile), --factory-tile, --focus-x, --focus-y (set from tableLayout in parts.js). */
@font-face { font-family: "Fraunces"; font-weight: 100 900; font-display: swap; src: url("fonts/Fraunces-Variable.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/Inter-Variable.ttf") format("truetype"); }

:root {
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, sans-serif;
  --cream: #F2EBDD;
  --ink: #1C1A17;
  --clay: #D9734A;
  --teal-center: #6699AA;
  --teal-mid: #1F4B5B;
  --teal-edge: #040C0F;
  --white: #FFFFFF;
  --tile: 28px;
  --factory-tile: 28px;
  --focus-x: 50%;
  --focus-y: 50%;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--body); color: var(--ink); background: var(--teal-edge); }

.az-header { background: var(--ink); color: var(--cream); font-family: var(--display); padding: .6em 1em; font-weight: 600; }
.az-header .az-action, .az-action { background: var(--clay); color: var(--ink); border: 0; font-family: var(--body); font-weight: 700; min-height: 44px; padding: 0 1.2em; border-radius: 8px; }

.az-table {
  position: relative; display: flex; overflow: hidden; width: 100%; height: 100%;
  background: radial-gradient(circle at var(--focus-x) var(--focus-y), var(--teal-center) 0%, var(--teal-mid) 45%, var(--teal-edge) 100%);
}
.az-table.az-phone { flex-direction: column; align-items: center; justify-content: flex-start; }
.az-sides { display: flex; flex-direction: column; justify-content: center; gap: 0; }
.az-middle { position: relative; display: flex; flex-direction: column; justify-content: center; flex: 1; }

/* tile: art plus bevel (top and left lighter, bottom and right darker), drawn above the art */
.az-tile { position: relative; width: var(--tile); height: var(--tile); display: inline-block; --edge-light: #FFFFFF; --edge-dark: #444444; --glow: #FFFFFF; }
.az-tile img { display: block; width: 100%; height: 100%; }
.az-tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 2px 2px 0 var(--edge-light), inset -2px -2px 0 var(--edge-dark); }
.az-blue { --edge-light: #8CC6E6; --edge-dark: #2F6F94; --glow: #4C9FCA; }
.az-yellow { --edge-light: #FFD25A; --edge-dark: #C98A12; --glow: #FFAA27; }
.az-red { --edge-light: #E8706A; --edge-dark: #96292A; --glow: #D3463D; }
.az-black { --edge-light: #5A5C66; --edge-dark: #0B0B0E; --glow: #47E1FD; }
.az-white { --edge-light: #FFFFFF; --edge-dark: #A9A59A; --glow: #1D3780; }
.az-token { background: var(--cream); color: var(--ink); font-family: var(--display); font-weight: 800; font-size: calc(var(--tile) * .6); display: inline-flex; align-items: center; justify-content: center; --edge-light: #FFFFFF; --edge-dark: #A9A59A; --glow: #D9734A; }

/* picked: grow, glow in its own color, wiggle; the other tiles stay as they are */
.az-tile.is-picked { transform: scale(1.25); box-shadow: 0 0 14px 4px var(--glow); animation: az-wiggle .5s ease-in-out infinite; z-index: 3; }
@keyframes az-wiggle {
  0% { transform: scale(1.25) rotate(calc(var(--a, 0deg) - 4deg)); }
  50% { transform: scale(1.25) rotate(calc(var(--a, 0deg) + 4deg)); }
  100% { transform: scale(1.25) rotate(calc(var(--a, 0deg) - 4deg)); }
}

/* board (position: relative anchors the scoring float, pages.css #231) */
.az-board { position: relative; background: var(--cream); border-radius: calc(var(--tile) * .3); padding: calc(var(--tile) * .5); width: calc(var(--tile) * 13); height: calc(var(--tile) * 7); display: flex; flex-direction: column; }
.az-play { display: flex; align-items: flex-start; gap: calc(var(--tile) * .0); height: calc(var(--tile) * 5); }
.az-lines { display: flex; flex-direction: column; width: calc(var(--tile) * 5); }
.az-line { display: flex; justify-content: flex-end; height: var(--tile); }
.az-slot { position: relative; width: var(--tile); height: var(--tile); border: 1px dashed var(--ink); }
.az-arrows { width: var(--tile); display: flex; flex-direction: column; }
.az-arrow { height: var(--tile); display: flex; align-items: center; justify-content: center; color: var(--clay); font-size: calc(var(--tile) * .5); }
.az-wall { display: grid; grid-template-columns: repeat(5, var(--tile)); grid-auto-rows: var(--tile); margin-left: var(--tile); }
.az-cell { width: var(--tile); height: var(--tile); }
.az-cell.az-empty { border: 3px solid var(--edge-dark); background: var(--cream); }
.az-foot { display: flex; align-items: flex-start; height: var(--tile); margin-top: 0; }
.az-floor { display: flex; width: calc(var(--tile) * 7); }
.az-pen { position: absolute; left: 0; top: 0; font-size: calc(var(--tile) * .3); font-weight: 700; }
.az-stats { margin-left: calc(var(--tile) * .5); display: flex; flex-direction: column; justify-content: center; height: var(--tile); }
.az-round { font-family: var(--body); font-size: .34em; line-height: 1; font-weight: 600; }
.az-score { font-family: var(--display); font-size: .56em; line-height: 1; font-weight: 800; }
.az-board { font-size: var(--tile); }
.az-board .az-slot, .az-board .az-cell, .az-board .az-arrow { font-size: inherit; }

/* factories */
.az-factories { display: flex; flex-wrap: wrap; justify-content: center; }
.az-factory { position: relative; width: calc(var(--factory-tile) * 3); height: calc(var(--factory-tile) * 3); --tile: var(--factory-tile); }
.az-plate { position: absolute; inset: 0; width: 100%; height: 100%; }
.az-factory-tiles { position: absolute; left: 50%; top: 50%; width: calc(var(--factory-tile) * 2); height: calc(var(--factory-tile) * 2); margin-left: calc(var(--factory-tile) * -1); margin-top: calc(var(--factory-tile) * -1); display: grid; grid-template-columns: 1fr 1fr; }

/* center */
.az-center { position: relative; width: 100%; height: calc(var(--factory-tile) * 6); --tile: var(--factory-tile); }
.az-item { position: absolute; left: calc(50% + (var(--x) - .5) * var(--factory-tile)); top: calc(50% + (var(--y) - .5) * var(--factory-tile)); transform: rotate(var(--a)); }
.az-item.is-picked { transform: scale(1.25) rotate(var(--a)); }
.az-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: calc(var(--factory-tile) * 1.1); color: var(--white); text-shadow: 3px 3px 0 var(--ink); }

.az-error { background: var(--cream); color: var(--ink); font-family: var(--body); padding: 1em; border-radius: 8px; }
