.die-scene { position: relative; display: grid; place-items: center; width: 72px; height: 71px; perspective: 300px; }
.die-cube { transform-style: preserve-3d; }
.die-cube { position: relative; width: 42px; height: 42px; }
.die-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  padding: 5px;
  border: 1px solid #8d6d4d;
  border-radius: 6px;
  backface-visibility: hidden;
  background: linear-gradient(145deg, #ffefd2, #dfb985);
  box-shadow: inset 0 0 3px #a06b45;
}
.die-face--1 { transform: translateZ(21px); }
.die-face--2 { transform: rotateY(90deg) translateZ(21px); }
.die-face--3 { transform: rotateX(90deg) translateZ(21px); }
.die-face--4 { transform: rotateX(-90deg) translateZ(21px); }
.die-face--5 { transform: rotateY(-90deg) translateZ(21px); }
.die-face--6 { transform: rotateY(180deg) translateZ(21px); }
.die-pip { width: 6px; height: 6px; border-radius: 50%; background: #4c281f; box-shadow: inset 0 1px 2px #210e09; }
.roll-overlay {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  grid-template-rows: 178px 66px;
  background: radial-gradient(ellipse at center, #322019b8, #100905ec 82%);
  pointer-events: none;
}
.roll-overlay .die-scene { align-self: center; transform: scale(3); }
.roll-overlay .roll-result {
  min-width: 2ch;
  text-align: center;
  font: 800 62px/1 Georgia, serif;
  color: #ffe5b2;
  text-shadow: 0 4px 20px #110a05;
}
#dice-sound { min-height: 34px; padding: 4px 9px; font-size: .8rem; }
.table-fx-ghost {
  position: fixed;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 8;
}
.table-fx-ghost > .field-card { margin: 0; width: 100%; }
.table-fx-marker {
  justify-self: center;
  align-self: start;
  padding: 4px 10px;
  border: 1px solid #be8756;
  border-radius: 20px;
  background: #35231a;
  color: #ffe2a5;
  font: 700 1rem Georgia, serif;
  box-shadow: 0 5px 12px #170b06a0;
}
[data-effect="damage"] > .table-fx-marker { color: #ffcab9; border-color: #b96753; }
.table-notices {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: 16px;
  width: min(400px, calc(100vw - 24px));
  pointer-events: none;
}
.table-notice {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  color: #f9e9c6;
  background: #2c1e17;
  border: 1px solid #bc8758;
  border-radius: 12px;
  box-shadow: 0 8px 28px #000a;
  pointer-events: auto;
}
.table-notice-card {
  display: grid;
  overflow: hidden;
  border: 1px solid #c09a68;
  border-radius: 6px;
  background: #5a4130;
  text-align: center;
}
.table-notice-card .card-face { box-shadow: none; }
.table-notice-details strong { color: #ffcf83; font-size: 1.05rem; }
.table-notice-details .table-notice-name { display: block; color: #fff3e0; font-size: 1.2rem; }
.table-notice-details p { margin: 6px 0 0; line-height: 1.4; overflow-wrap: anywhere; }
.table-notice-close { align-self: start; min-width: 32px; min-height: 32px; padding: 0; font-size: 1.3rem; }
@media (prefers-reduced-motion: no-preference) {
  .table-notice { animation: reveal-table-notice 260ms ease-out both; }
  @keyframes reveal-table-notice {
    from { transform: translateY(20px) scale(.96); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}
@media (max-width: 650px) {
  #dice-sound { min-height: 44px; }
}

.table-activity {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  max-width: 100%;
  padding: 5px 1px;
}
.table-activity-card {
  flex: 0 0 76px;
  overflow: hidden;
  border: 1px solid #d6a765;
  border-radius: 6px;
  background: #2c1e17;
  color: #fff0d1;
  text-align: center;
}
.table-activity-card .card-face { width: 100%; box-shadow: none; }
@media (max-width: 650px) {
  .table-activity-card { flex-basis: 64px; }
}

/* Brief card-local effects; the table remains clickable throughout. */
.combat-burst { --fx-color: #f0b853; z-index: 20; }
.combat-burst--hit { --fx-color: #fff0bd; }
.combat-burst--damage, .combat-burst--death { --fx-color: #e15d49; }
.combat-burst--shield, .combat-burst--soul { --fx-color: #9be6ef; }
.combat-spark {
  position: absolute; width: 9px; height: 9px; border-radius: 50% 50% 50% 0;
  background: var(--fx-color); box-shadow: 0 0 7px var(--fx-color);
}
.combat-slash {
  position: absolute; width: 90%; height: 4px; border-radius: 50%;
  background: #fff6d5; box-shadow: 0 0 11px var(--fx-color), 0 0 3px #fff;
}
[data-effect="miss"] > .table-fx-marker { font-size: 1.7rem; color: #c6e0e7; }

/* Resources stay beside their counters. Cards follow their actual source/destination. */
.coin-flight { z-index: 22; perspective: 160px; }
.fx-coin {
  display: grid; place-items: center; width: 16px; height: 16px;
  border: 2px solid #ad732e; border-radius: 50%;
  background: linear-gradient(135deg, #fff0ac, #efbb56 55%, #c88732);
  color: #80501f; font: 900 12px/1 Georgia, serif;
  box-shadow: inset 1px 1px #fff3bd, 0 2px 4px #13090566;
}
.card-flight, .deal-flight { z-index: 18; transform-origin: center; }
.card-flight > * { width: 100%; max-width: none; height: 100%; margin: 0; }
.deal-flight img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  border-radius: 7px; filter: drop-shadow(0 7px 7px #12080366);
}
.combat-shield {
  position: absolute; width: 65%; height: 82%;
  border: 3px solid #b8edf3; border-radius: 38% 38% 55% 55%;
  background: linear-gradient(135deg, #d4faff50, #68c7dc12);
  box-shadow: 0 0 10px #93e7f570;
}
.table-notices { display: flex; flex-direction: column; gap: 8px; }
.table-fx-marker { white-space: nowrap; }
