:root {
  --background: #081425;
  --background-soft: #0d1d33;
  --surface: rgba(16, 36, 61, 0.94);
  --surface-light: rgba(28, 54, 83, 0.94);
  --border: rgba(255, 255, 255, 0.13);
  --text: #f8fbff;
  --muted: #aebed2;
  --primary: #efb42b;
  --primary-dark: #bb7711;
  --danger: #e95656;
  --success: #55cf86;

  --red: #d84040;
  --green: #27a968;
  --yellow: #e6b92f;
  --blue: #3187d7;
  --pink: #da5798;
  --black: #181a20;

  --card-width: clamp(72px, 7.2vw, 112px);
  --card-radius: 10px;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(49, 135, 215, 0.22), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(218, 87, 152, 0.15), transparent 30%),
    linear-gradient(145deg, #07101e, #0b1c31 52%, #07111f);
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(239, 180, 43, 0.8);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

.noscript-message {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 30px;
  color: white;
  font-size: 1.1rem;
  text-align: center;
  background: #111827;
}

/* Tela inicial */

.start-screen {
  display: grid;
  place-items: center;
  padding: 36px 18px;
}

.start-panel {
  width: min(980px, 100%);
  padding: clamp(28px, 5vw, 60px);
  text-align: center;
  background:
    linear-gradient(145deg, rgba(24, 50, 82, 0.97), rgba(8, 25, 45, 0.97));
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.logo-mark,
.compact-logo-mark {
  display: inline-grid;
  place-items: center;
  color: #081425;
  font-weight: 1000;
  background:
    linear-gradient(145deg, #ffe286, var(--primary) 55%, #ce7b12);
  box-shadow:
    0 10px 30px rgba(239, 180, 43, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.7);
}

.logo-mark {
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  font-size: 2.8rem;
  border-radius: 23px;
  transform: rotate(-5deg);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.game-logo {
  margin: 0;
  font-size: clamp(3rem, 11vw, 7rem);
  font-weight: 1000;
  line-height: 0.95;
  letter-spacing: -0.075em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.start-description {
  max-width: 660px;
  margin: 24px auto;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.15rem);
  line-height: 1.7;
}

.start-options {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  margin: 24px auto;
  text-align: left;
}

.start-options label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.start-options select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  color: var(--text);
  background: #0a1728;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  font-weight: 900;
  border: 0;
  border-radius: 13px;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease;
}

.button:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.button:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: #111827;
  background: linear-gradient(145deg, #ffd86d, var(--primary));
  box-shadow: 0 12px 25px rgba(239, 180, 43, 0.18);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--border);
}

.category-guide {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 11px;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.category-item strong,
.category-item small {
  display: block;
}

.category-item strong {
  font-size: 0.78rem;
  line-height: 1.25;
}

.category-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
}

.category-dot,
.status-color-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
}

.category-red .category-dot {
  background: var(--red);
}

.category-green .category-dot {
  background: var(--green);
}

.category-yellow .category-dot {
  background: var(--yellow);
}

.category-blue .category-dot {
  background: var(--blue);
}

.category-pink .category-dot {
  background: var(--pink);
}

.asset-status {
  min-height: 20px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Cabeçalho da partida */

.game-screen {
  padding-bottom: env(safe-area-inset-bottom);
}

.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding:
    calc(10px + env(safe-area-inset-top))
    clamp(12px, 3vw, 30px)
    10px;
  background: rgba(5, 15, 28, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.compact-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.compact-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.header-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-status::-webkit-scrollbar {
  display: none;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid var(--border);
  border-radius: 999px;
}

#turnBadge.active-human {
  color: #142033;
  background: var(--primary);
  border-color: transparent;
}

#turnBadge.active-bot {
  color: white;
  background: #3168a5;
  border-color: transparent;
}

.direction-badge span:first-child {
  display: inline-block;
  color: var(--primary);
  font-size: 1.15rem;
  transition: transform 350ms ease;
}

.direction-badge.reversed span:first-child {
  transform: scaleX(-1);
}

.penalty-status {
  color: white;
  background: rgba(217, 58, 58, 0.78);
}

.header-actions {
  display: flex;
  gap: 7px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  color: var(--text);
  font-weight: 900;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: 160ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

/* Mesa */

.game-table {
  position: relative;
  display: grid;
  grid-template-areas:
    "bots bots"
    "center messages"
    "human human";
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
  grid-template-rows: auto minmax(310px, 1fr) auto;
  gap: 14px;
  width: min(1500px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 16px;
}

.game-table::before {
  position: absolute;
  inset: 8% 8% 20%;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle, rgba(29, 100, 81, 0.35), rgba(10, 45, 47, 0.06) 68%);
  border: 1px solid rgba(111, 239, 185, 0.09);
  border-radius: 48%;
  filter: blur(2px);
}

.bots-area {
  grid-area: bots;
  display: flex;
  justify-content: space-evenly;
  align-items: start;
  gap: 12px;
  min-height: 118px;
}

.bot-player {
  position: relative;
  min-width: 140px;
  max-width: 230px;
  padding: 10px 12px;
  text-align: center;
  background: rgba(10, 28, 49, 0.86);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.bot-player.active {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px rgba(239, 180, 43, 0.14),
    0 12px 32px rgba(0, 0, 0, 0.24);
  transform: translateY(4px);
}

.bot-player.blocked {
  animation: blocked-shake 500ms ease;
}

.bot-name-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.bot-name {
  font-size: 0.8rem;
  font-weight: 900;
}

.bot-count {
  min-width: 23px;
  padding: 3px 7px;
  color: #142033;
  font-size: 0.68rem;
  font-weight: 1000;
  background: var(--primary);
  border-radius: 999px;
}

.bot-hand {
  display: flex;
  justify-content: center;
  min-height: 66px;
  padding-left: 24px;
}

.bot-card-back {
  width: 43px;
  margin-left: -24px;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.25));
  transform-origin: bottom center;
}

.bot-card-back:nth-child(2n) {
  transform: rotate(3deg);
}

.bot-card-back:nth-child(2n + 1) {
  transform: rotate(-3deg);
}

.bot-overflow {
  align-self: center;
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.center-table {
  grid-area: center;
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(150px, 330px) minmax(90px, auto);
  justify-content: center;
  align-items: center;
  gap: clamp(13px, 3vw, 34px);
  min-height: 310px;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(38, 113, 84, 0.25), transparent 70%),
    rgba(7, 22, 38, 0.5);
  border: 1px solid var(--border);
  border-radius: 26px;
}

.pile-section {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.card-pile {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--card-width);
  min-height: calc(var(--card-width) * 1.4);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--card-radius);
}

.card-pile img {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
  filter: drop-shadow(0 14px 15px rgba(0, 0, 0, 0.37));
  user-select: none;
  -webkit-user-drag: none;
}

.draw-pile:not(:disabled):hover img {
  transform: translateY(-5px) rotate(-1.5deg);
}

.draw-pile img {
  transition: transform 180ms ease;
}

.draw-pile:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.draw-pile::before,
.draw-pile::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: #d7dce5;
  border-radius: var(--card-radius);
}

.draw-pile::before {
  transform: translate(5px, 3px);
}

.draw-pile::after {
  transform: translate(9px, 6px);
}

.pile-counter {
  position: absolute;
  right: -10px;
  bottom: -8px;
  min-width: 30px;
  padding: 6px 8px;
  color: #132033;
  font-size: 0.74rem;
  font-weight: 1000;
  background: var(--primary);
  border: 3px solid #0b1c31;
  border-radius: 999px;
}

.pile-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.discard-pile .game-card-image {
  animation: card-discard 300ms cubic-bezier(0.2, 0.85, 0.35, 1.2);
}

.table-information {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.main-turn-message {
  max-width: 340px;
  min-height: 54px;
  color: white;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 1000;
  line-height: 1.25;
}

.category-display {
  min-width: 180px;
  padding: 12px 16px;
  background: rgba(4, 14, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.category-display span,
.category-display strong {
  display: block;
}

.category-display span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.category-display strong {
  font-size: 0.92rem;
}

.stack-display {
  padding: 9px 12px;
  color: white;
  font-size: 0.78rem;
  background: rgba(210, 50, 50, 0.75);
  border-radius: 10px;
  animation: penalty-pulse 800ms ease-in-out infinite alternate;
}

.message-panel {
  grid-area: messages;
  align-self: stretch;
  min-height: 260px;
  overflow: hidden;
  background: rgba(8, 25, 44, 0.82);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.message-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 43px;
  padding: 0 13px;
  border-bottom: 1px solid var(--border);
}

.message-panel-header strong {
  font-size: 0.75rem;
}

.message-panel-header button {
  padding: 4px 7px;
  color: var(--muted);
  font-size: 0.68rem;
  background: transparent;
  border: 0;
}

.message-log {
  display: flex;
  flex-direction: column-reverse;
  gap: 7px;
  max-height: 330px;
  margin: 0;
  padding: 11px;
  overflow-y: auto;
  list-style: none;
}

.message-log li {
  padding: 8px 9px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  animation: message-enter 220ms ease;
}

.message-log li.message-important {
  color: white;
  border-left-color: var(--primary);
}

.message-log li.message-penalty {
  color: white;
  border-left-color: var(--danger);
}

.message-log li.message-success {
  color: white;
  border-left-color: var(--success);
}

/* Jogador humano */

.human-area {
  grid-area: human;
  min-width: 0;
  padding: 12px 14px 15px;
  background: rgba(7, 22, 39, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: box-shadow 220ms ease, border-color 220ms ease;
}

.human-area.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(239, 180, 43, 0.11);
}

.human-information {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.player-label {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

#humanName {
  font-size: 0.92rem;
}

.human-card-count {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.human-hand {
  display: flex;
  align-items: end;
  min-height: calc(var(--card-width) * 1.55);
  padding: 12px 8px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.human-card {
  position: relative;
  flex: 0 0 var(--card-width);
  width: var(--card-width);
  margin-right: clamp(-25px, -1.4vw, -8px);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--card-radius);
  transform-origin: bottom center;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.human-card:last-child {
  margin-right: 0;
}

.human-card img {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.3));
  user-select: none;
  -webkit-user-drag: none;
}

.human-card.playable:hover,
.human-card.playable:focus-visible,
.human-card.selected {
  z-index: 10;
  transform: translateY(-17px) scale(1.035);
}

.human-card.playable {
  cursor: pointer;
}

.human-card.unplayable {
  cursor: not-allowed;
  filter: saturate(0.55) brightness(0.5);
  opacity: 0.72;
}

.human-card.selected::after {
  position: absolute;
  inset: -5px;
  content: "";
  pointer-events: none;
  border: 3px solid var(--primary);
  border-radius: calc(var(--card-radius) + 5px);
  box-shadow: 0 0 22px rgba(239, 180, 43, 0.55);
}

.human-card.dealing {
  animation: deal-card 460ms backwards cubic-bezier(0.2, 0.85, 0.35, 1.2);
}

.human-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 9px;
}

.button-buy {
  color: white;
  background: linear-gradient(145deg, #2d6ca8, #24517f);
}

.button-tribuno {
  color: #162033;
  background: linear-gradient(145deg, #ffdd70, var(--primary));
}

.button-tribuno.ready {
  animation: tribuno-pulse 700ms ease-in-out infinite alternate;
}

/* Modais */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 7, 14, 0.8);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  padding: clamp(22px, 5vw, 38px);
  overflow-y: auto;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(26, 54, 85, 0.99), rgba(8, 25, 44, 0.99));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: modal-enter 220ms ease-out;
}

.modal-card h2 {
  margin: 0 0 20px;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.1;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rules-card {
  width: min(800px, 100%);
}

.rules-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.rules-content article {
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
}

.rules-content h3 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.86rem;
}

.rules-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.modal-confirm {
  display: block;
  margin: 20px auto 0;
}

.color-choices {
  display: grid;
  gap: 9px;
}

.color-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  color: white;
  font-weight: 900;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: 160ms ease;
}

.color-choice:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.color-choice span {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.color-red span {
  background: var(--red);
}

.color-green span {
  background: var(--green);
}

.color-yellow span {
  background: var(--yellow);
}

.color-blue span {
  background: var(--blue);
}

.color-pink span {
  background: var(--pink);
}

.drawn-card-modal-card {
  width: min(460px, 100%);
  text-align: center;
}

.drawn-card-preview {
  display: grid;
  place-items: center;
  min-height: 230px;
  margin: 16px 0 22px;
}

.drawn-card-preview img {
  width: min(150px, 45vw);
  height: auto;
  border-radius: var(--card-radius);
  filter: drop-shadow(0 18px 15px rgba(0, 0, 0, 0.4));
  animation: card-discard 300ms ease-out;
}

.drawn-card-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.result-card {
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  color: #102033;
  font-size: 2.6rem;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(239, 180, 43, 0.32);
  animation: victory-bounce 650ms ease-in-out infinite alternate;
}

.result-card.defeat .result-icon {
  color: white;
  background: var(--danger);
  box-shadow: 0 0 35px rgba(233, 86, 86, 0.27);
}

.result-card p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

/* Efeitos globais */

body.fx-special .center-table {
  animation: special-flash 430ms ease;
}

body.fx-penalty .center-table {
  animation: penalty-flash 430ms ease;
}

body.fx-reverse .direction-badge {
  animation: reverse-spin 550ms ease;
}

body.fx-tribuno .button-tribuno {
  animation: tribuno-burst 550ms ease;
}

/* Animações */

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes card-discard {
  from {
    opacity: 0.45;
    transform: translateY(-30px) rotate(-8deg) scale(1.15);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes deal-card {
  from {
    opacity: 0;
    transform: translateY(-100px) scale(0.7) rotate(-12deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes message-enter {
  from {
    opacity: 0;
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes penalty-pulse {
  to {
    transform: scale(1.035);
    box-shadow: 0 0 20px rgba(233, 86, 86, 0.25);
  }
}

@keyframes tribuno-pulse {
  to {
    transform: scale(1.06);
    box-shadow: 0 0 25px rgba(239, 180, 43, 0.55);
  }
}

@keyframes tribuno-burst {
  30% {
    transform: scale(1.15) rotate(-2deg);
  }

  60% {
    transform: scale(1.08) rotate(2deg);
  }
}

@keyframes victory-bounce {
  to {
    transform: translateY(-8px) rotate(5deg);
  }
}

@keyframes blocked-shake {
  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

@keyframes special-flash {
  35% {
    box-shadow:
      inset 0 0 80px rgba(239, 180, 43, 0.32),
      0 0 45px rgba(239, 180, 43, 0.25);
  }
}

@keyframes penalty-flash {
  35% {
    box-shadow:
      inset 0 0 90px rgba(233, 86, 86, 0.4),
      0 0 50px rgba(233, 86, 86, 0.28);
  }
}

@keyframes reverse-spin {
  50% {
    transform: rotate(180deg) scale(1.08);
  }
}

/* Responsividade */

@media (max-width: 1000px) {
  .category-guide {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .category-item:last-child {
    grid-column: 1 / -1;
  }

  .game-table {
    grid-template-areas:
      "bots"
      "center"
      "messages"
      "human";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
  }

  .message-panel {
    min-height: auto;
  }

  .message-log {
    max-height: 140px;
  }
}

@media (max-width: 760px) {
  :root {
    --card-width: clamp(74px, 23vw, 96px);
  }

  .game-header {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .compact-logo {
    font-size: 0.88rem;
  }

  .header-status {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: start;
    order: 3;
  }

  .game-table {
    min-height: calc(100vh - 108px);
    padding: 9px;
  }

  .bots-area {
    justify-content: start;
    padding: 3px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .bot-player {
    flex: 0 0 155px;
    scroll-snap-align: start;
  }

  .center-table {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    min-height: 300px;
    padding: 20px 13px;
  }

  .table-information {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .pile-section:nth-of-type(1) {
    grid-column: 1;
    grid-row: 2;
  }

  .pile-section:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .human-area {
    position: sticky;
    bottom: 0;
    z-index: 80;
    padding-bottom: calc(13px + env(safe-area-inset-bottom));
    background: rgba(6, 19, 34, 0.97);
    backdrop-filter: blur(15px);
  }

  .human-hand {
    padding-inline: 4px;
    scroll-snap-type: x proximity;
  }

  .human-card {
    margin-right: -30px;
    scroll-snap-align: center;
  }

  .human-card:last-child {
    padding-right: 12px;
  }

  .rules-content {
    grid-template-columns: 1fr;
  }

  .button-buy,
  .button-tribuno {
    flex: 1;
    min-height: 54px;
  }
}

@media (max-width: 440px) {
  .start-panel {
    padding: 26px 16px;
    border-radius: 22px;
  }

  .start-actions {
    display: grid;
  }

  .start-actions .button {
    width: 100%;
  }

  .category-guide {
    grid-template-columns: 1fr;
  }

  .category-item:last-child {
    grid-column: auto;
  }

  .game-logo {
    font-size: 3.5rem;
  }

  .compact-logo > span:last-child {
    display: none;
  }

  .header-actions {
    justify-content: end;
  }

  .status-pill {
    min-height: 31px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .center-table {
    border-radius: 18px;
  }

  .main-turn-message {
    min-height: 42px;
    font-size: 1.05rem;
  }

  .modal {
    align-items: end;
    padding: 8px;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 12px 12px;
  }

  .drawn-card-actions,
  .result-actions {
    display: grid;
  }

  .drawn-card-actions .button,
  .result-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
