/* Feuille de style du jeu des Cases.
   Sections : variables, page, plateau, barre de sorts, chat, carte de stats, modals. */

/* --- variables ------------------------------------------------------------ */

:root {
  --modal-bg: #f3e4c6;
  --modal-bg-deep: #d7b87a;
  --modal-ink: #2b2416;
  --modal-accent: #b5632b;
  --modal-accent-deep: #6b2f16;
  --modal-border: #5f4522;
  --modal-glow: rgba(66, 40, 18, 0.45);
  --page-bg: #b89b63;
  --page-bg-deep: #6f5732;
  --page-ink: #2b2416;
  --panel-bg: rgba(246, 236, 214, 0.4);
  --panel-border: rgba(84, 63, 33, 0.7);
  --spell-size: clamp(52px, 6vw, 92px);
}

/* --- page ------------------------------------------------------------------ */

body {
  font-family: "Open Sans", Helvetica, sans-serif;
  text-align: center;
  margin: 1vmin;
  background: var(--page-bg);
  background-image: radial-gradient(
      circle at 15% 15%,
      rgba(255, 240, 210, 0.5),
      rgba(255, 240, 210, 0) 40%
    ),
    radial-gradient(
      circle at 85% 10%,
      rgba(120, 90, 46, 0.35),
      rgba(120, 90, 46, 0) 55%
    ),
    linear-gradient(135deg, var(--page-bg), var(--page-bg-deep));
  background-attachment: fixed;
  color: var(--page-ink);
  user-select: none;
  overflow: hidden;
  box-sizing: border-box;
}

a {
  color: black;
}

#divHeader {
  width: 100%;
  height: 6vh;
  border: 0.2em solid rgb(71, 65, 43);
  border-radius: 1em;
  box-shadow: 0px 8px 18px -14px #382c12;
  background: linear-gradient(135deg, #f4e3c1, #c8a36a);
  color: #3a2a18;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5vw;
  font-family: "Corben", "Open Sans Condensed", serif;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

#divBody {
  width: 100vw;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1.2vw;
  padding: 0.8vw 1vw;
  box-sizing: border-box;
}

/* --- plateau ----------------------------------------------------------------- */

#divBoard {
  width: 60vw;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: width 220ms ease;
}

#board {
  width: 43vw;
  height: 43vw;
  table-layout: fixed;
  box-sizing: border-box;
  box-shadow: 0px 5px 20px -10px #111111;
  border: 3px solid rgba(78, 61, 33, 0.7);
  border-radius: 12px;
  transition: width 220ms ease, height 220ms ease;
  background-image: url("img/grounds/dirt.png");
}

#board.dirt {
  background-image: url("img/grounds/dirt.png");
}

#board.sand {
  background-image: url("img/grounds/sand.png");
}

#board.grass {
  background-image: url("img/grounds/grass.png");
}

#board.jungle {
  background-image: url("img/grounds/jungle.png");
}

#board.water {
  background-image: url("img/grounds/water.png");
}

td.cell {
  overflow: visible;
  border: 1px solid rgb(71, 65, 43);
  height: 10%;
  width: 10%;
}

.cellAlly {
  border-bottom: 1px solid rgb(17, 0, 255) !important;
}

.cellEnemy {
  border-bottom: 1px solid rgb(255, 0, 0) !important;
}

.divCell {
  height: 100%;
  width: 100%;
  position: relative;
  overflow: visible;
}

.artEntite {
  z-index: 10;
  position: absolute;
  top: -9999px;
  bottom: -9999px;
  left: -9999px;
  right: -9999px;
  display: block;
  margin: auto;
  max-height: 100%;
  -webkit-filter: drop-shadow(1vmin 0vmin 0.3vmin rgba(34, 34, 34, 0.397));
  filter: drop-shadow(1vmin 0vmin 0.1vmin rgba(34, 34, 34, 0.397));
}

/* l'image d'origine est masquée pendant qu'un clone d'animation la remplace */
.cell.anim-hide-entity .artEntite {
  visibility: hidden;
}

/* surbrillances de prévisualisation */

.previsuPMPlusieurs {
  background-color: darkgreen !important;
  cursor: pointer;
}

.previsuPMMob {
  background-color: rgba(41, 182, 41);
}

.previsuSort {
  background-color: royalblue;
}

.previsuSort:hover {
  background-color: red;
  cursor: pointer;
}

.previsuSortCroix:hover {
  position: relative;
  z-index: 1;
  box-shadow: 4.3vw 0 red, -4.3vw 0 red, 0 4.3vw red, 0 -4.3vw red;
}

.glyph {
  background-color: rgb(178, 34, 34, 0.5);
  border: 2px solid firebrick;
  box-shadow: inset 0px 0px 0px 2px firebrick;
}

.pointer:hover {
  cursor: pointer;
}

/* --- barre de sorts --------------------------------------------------------------- */

#divSorts {
  width: calc(var(--spell-size) * 2 + 2vw);
  display: flex;
  justify-content: center;
  align-items: center;
}

#tabSorts {
  width: calc(var(--spell-size) * 2 + 0.6vw);
  border-radius: 1vw;
  border-collapse: separate;
  border-spacing: 0.6vw 0.6vw;
  padding: 0.6vw;
  background: rgba(24, 18, 10, 0.22);
  box-shadow: inset 0 0 14px rgba(20, 12, 6, 0.35),
    0px 10px 22px -18px rgba(0, 0, 0, 0.6);
  table-layout: fixed;
}

td.sort {
  border: none;
  border-radius: 14%;
  height: var(--spell-size);
  width: var(--spell-size);
  padding: 0;
  background: radial-gradient(
      circle at 35% 30%,
      rgba(255, 237, 199, 0.25),
      rgba(255, 237, 199, 0) 55%
    ),
    linear-gradient(145deg, rgba(87, 61, 28, 0.55), rgba(40, 28, 12, 0.7));
  box-shadow: inset 0 0 10px rgba(12, 8, 4, 0.6),
    0 6px 12px -10px rgba(0, 0, 0, 0.7);
}

.spellHov {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12%;
  background: linear-gradient(
    145deg,
    rgba(255, 223, 168, 0.08),
    rgba(0, 0, 0, 0.15)
  );
}

.spellHov:hover {
  box-shadow: 0px 0px 10px rgb(62, 235, 32);
}

.sort .artSpell {
  width: 86%;
  height: 86%;
  object-fit: contain;
  display: block;
  border-radius: 10%;
}

td.sort.sort-draggable {
  cursor: grab;
}

td.sort.sort-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

td.sort.sort-drop-target {
  outline: 2px solid rgba(255, 208, 122, 0.9);
  outline-offset: -6px;
}

/* sort trop cher en PA ou en cooldown */
.disabled {
  -webkit-filter: grayscale(1);
  filter: brightness(30%);
}

.disabled:hover {
  box-shadow: none;
}

#tdPass {
  padding: 0;
}

button.pass {
  width: 100%;
  height: calc(var(--spell-size) * 0.7);
  border-radius: 12px;
  border: 1px solid rgba(68, 38, 12, 0.7);
  background: linear-gradient(145deg, #f2a040, #c56414);
  color: #2a1b0f;
  font-size: clamp(14px, 1.4vw, 22px);
  font-weight: 700;
  letter-spacing: 0.04em;
  align-items: center;
  text-transform: uppercase;
  box-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.55);
}

/* --- chat ---------------------------------------------------------------------- */

#chatPanel {
  width: 27vw;
  margin: 0 1vh 0 1vh;
  position: relative;
  display: flex;
  align-items: stretch;
  transition: width 220ms ease, margin 220ms ease;
}

#statusenrobage {
  border-radius: 2%;
  overflow: auto;
  height: 90vh;
  max-height: 100vmin;
  width: 100%;
  margin: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0px 10px 26px -16px #111111, inset 0 0 8px #382c12;
  transition: width 220ms ease, opacity 220ms ease, padding 220ms ease,
    border 220ms ease, transform 220ms ease;
}

#status {
  font-size: 1vw;
  font-weight: 600;
  text-align: left;
  margin: 1vw;
  color: var(--page-ink);
}

.chat-description {
  font-style: italic;
  color: #006600;
}

.chat-injonction {
  color: #800000;
}

.toggle-chat {
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(68, 38, 12, 0.7);
  background: linear-gradient(145deg, #f2a040, #c56414);
  color: #2a1b0f;
  font-weight: 700;
  box-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  z-index: 2;
}

.toggle-chat:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 10px 18px -12px rgba(0, 0, 0, 0.55);
}

.toggle-chat:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(181, 99, 43, 0.4),
    0 10px 18px -12px rgba(0, 0, 0, 0.55);
}

#chatPanel.collapsed {
  width: 2.6vw;
  min-width: 34px;
  margin: 0;
}

#chatPanel.collapsed #statusenrobage {
  width: 0;
  opacity: 0;
  padding: 0;
  border: 0;
  transform: translateX(10px);
  overflow: hidden;
  pointer-events: none;
}

/* chat replié : le plateau profite de la place libérée */
#divBody.chat-collapsed #divBoard {
  width: 70vw;
}

#divBody.chat-collapsed #board {
  width: min(55vw, 80vh);
  height: min(55vw, 80vh);
}

/* --- carte de stats ---------------------------------------------------------------- */

#divStats {
  width: 27vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  display: inline-block;
  width: 15vw;
  padding: 1em;
  border-radius: 5%;
  margin: 1em;
  background: #ddd;
  text-align: left;
  box-shadow: 0px 5px 20px -10px #111111;
  position: relative;
  transition: 0.4s;
  font-size: 1vw;
}

.card:hover {
  z-index: 5;
  box-shadow: 0px 13px 30px -15px #000000;
  transform: translateY(-10px);
}

.card--normal {
  background: linear-gradient(110deg, #fdbb2d 0%, #3a1c71 100%);
  box-shadow: 0px 5px 20px -10px #3a1c71;
}

.card_title {
  margin: 0;
  font-weight: 400;
}

.card__caption {
  background-color: rgba(255, 255, 255, 0.65);
  padding: 1em;
  position: relative;
  border-radius: 0 0 3px 3px;
}

.card__image-container {
  background-color: rgba(49, 42, 32, 0.7);
  text-align: center;
  padding: 1em 1em 0;
  border-radius: 3px 3px 0 0;
}

.card__name {
  font-family: "Open Sans Condensed", "Open Sans", helvetica, sans-serif;
  text-align: center;
  font-size: 1.5vw;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card__stats {
  margin: 1em 0;
  width: 100%;
}

.card__stats th {
  font-family: "Open Sans Condensed", "Open Sans", helvetica, sans-serif;
  text-align: right;
  font-weight: 600;
}

.card__stats th,
.card__stats td {
  width: 50%;
  padding: 0.25em 0.5em 0;
}

.card__abilities {
  display: flex;
  justify-content: space-between;
}

.card__ability {
  margin-top: 1em;
  flex: 1 0;
}

.artSpell {
  border-radius: 10%;
  max-width: 100%;
}

/* sorts de l'entité affichés dans la carte */
.card__spells-title {
  text-align: center;
  font-weight: 600;
}

.card__spells {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
  margin-top: 0.4em;
}

.card__spell-icon {
  width: 2.4em;
  height: 2.4em;
  object-fit: cover;
  border-radius: 15%;
  border: 1px solid rgba(49, 42, 32, 0.6);
  background-color: rgba(49, 42, 32, 0.12);
  cursor: help;
  transition: transform 0.15s;
}

.card__spell-icon:hover {
  transform: scale(1.15);
}

/* infobulle détaillée d'un sort */
.tooltip-sort .tooltip-inner {
  max-width: 16rem;
  text-align: left;
  padding: 0.5rem 0.6rem;
}

.tooltip-sort .spell-tip__name {
  text-align: center;
  font-weight: 700;
  margin-bottom: 0.3em;
}

.tooltip-sort .spell-tip__row {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
}

.tooltip-sort .spell-tip__label {
  font-weight: 600;
  white-space: nowrap;
}

.tooltip-sort .spell-tip__value {
  text-align: right;
}

.tooltip-sort .spell-tip__desc {
  margin-top: 0.4em;
  font-style: italic;
  opacity: 0.9;
}

.smallerText {
  font-size: 0.75vw;
}

/* --- modals ------------------------------------------------------------------------- */

.modal-backdrop.show {
  opacity: 0.6;
  background: radial-gradient(circle at 20% 20%, #2a271c, #0f0e0a);
}

.modal-content {
  background: radial-gradient(
      circle at 20% 0%,
      rgba(255, 246, 226, 0.95),
      rgba(255, 246, 226, 0.4) 55%,
      rgba(255, 246, 226, 0) 70%
    ),
    linear-gradient(135deg, var(--modal-bg), var(--modal-bg-deep));
  border: 3px solid var(--modal-border);
  border-radius: 18px;
  box-shadow: 0 12px 40px -18px var(--modal-glow),
    inset 0 0 0 2px rgba(255, 255, 255, 0.3);
  color: var(--modal-ink);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.08) 6px,
      rgba(0, 0, 0, 0.04) 6px,
      rgba(0, 0, 0, 0.04) 12px
    ),
    radial-gradient(circle at 85% 15%, rgba(0, 0, 0, 0.15), transparent 45%);
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.4;
}

.modal-header,
.modal-footer {
  border: none;
  position: relative;
  z-index: 1;
}

.modal-header {
  padding: 1.2rem 1.6rem 0.6rem;
}

.modal-title {
  font-family: "Corben", "Open Sans Condensed", serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--modal-accent-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.modal .modal-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  align-items: stretch;
  padding: 1.2rem 1.6rem 1.6rem;
}

.modal.fade .modal-dialog {
  transform: translateY(30px) scale(0.98);
  transition: transform 220ms ease;
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

button.choice {
  height: 100%;
  width: 100%;
  justify-content: space-around;
  align-items: center;
  display: flex;
  font-size: 1.7vmin;
}

.modal-body .btn.choice {
  background: linear-gradient(145deg, #f7cf7a, #d0923e);
  border: 1px solid rgba(68, 38, 12, 0.6);
  border-radius: 12px;
  color: #2a1b0f;
  font-family: "Open Sans Condensed", "Open Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.5);
}

.modal-body .btn.choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px -12px rgba(0, 0, 0, 0.55);
}

.modal-body .btn.choice:focus {
  box-shadow: 0 0 0 2px rgba(181, 99, 43, 0.4),
    0 10px 18px -12px rgba(0, 0, 0, 0.55);
}

.modal-body .btn-success.choice {
  background: linear-gradient(145deg, #a8d67e, #6b9f46);
}

.modal-body .btn-danger.choice {
  background: linear-gradient(145deg, #e58e74, #b14d2f);
}

.modal-body .btn-info.choice {
  background: linear-gradient(145deg, #9fcfe3, #4c8baa);
}

.modal-body .btn-dark.choice {
  background: linear-gradient(145deg, #8b7b60, #3b2c1c);
  color: #f0e6d6;
}

.modal-body .btn-primary.choice {
  background: linear-gradient(145deg, #cbb76f, #8f6a2f);
  color: #2a1b0f;
}

/* modal de choix d'apparence */

.divBtnArrow {
  width: 25%;
  height: 50%;
}

.arrow {
  width: 1% !important;
  height: 15vh;
  display: flex;
  justify-content: center;
}

img.svg {
  width: 3em;
  height: 3em;
}

img.chooseSkin {
  max-height: 30vh;
  margin: auto;
  -webkit-filter: drop-shadow(3px 3px 5px #222);
  filter: drop-shadow(3px 3px 5px #222);
}

img.chooseSkinGround {
  min-height: 64px;
  margin: auto;
  border-radius: 5px;
  box-shadow: 3px 3px 5px rgb(54, 54, 54);
}

#boutonJouer {
  font-size: 3vmin;
}

/* modal de bonus */

.bonusIco {
  height: 3.3em;
  width: 3.3em;
  padding: 1%;
}

.bonusTxt {
  padding: 1%;
  width: 60%;
}

.bouton_bon {
  width: 16vw;
}

.modal-body .bouton_bon {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(95, 69, 34, 0.35);
  border-radius: 14px;
  padding: 0.2rem;
  box-shadow: 0 6px 16px -12px rgba(0, 0, 0, 0.35);
}

.modal-body .bouton_bonus,
.modal-body .bouton_bonus_rare {
  width: 16vw;
  min-width: 170px;
}

.modal-body .bouton_bonus_classe {
  width: 14vw;
  min-width: 140px;
}

/* modals de fin de partie et portrait */

#modalPortrait .modal-content {
  text-align: center;
  font-family: "Open Sans Condensed", "Open Sans", sans-serif;
  font-size: 1.05rem;
}

#modalGameOver .modal-body {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}

#modalGameOver .game-over-score {
  font-family: "Open Sans Condensed", "Open Sans", sans-serif;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 700;
}

#modalGameOver .game-over-record {
  font-family: "Open Sans Condensed", "Open Sans", sans-serif;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  opacity: 0.85;
}

#modalGameOver .modal-footer {
  padding-bottom: 1.4rem;
}

#modalGameOver .btn.choice {
  width: auto;
  height: auto;
  padding: 0.6rem 1.6rem;
  min-width: 180px;
}
