* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: #15100b;
  color: #f5f5f5;
}

#app {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.start-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: #080604;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.start-screen__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at 50% 52%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.58) 76%);
  pointer-events: none;
}

.start-screen__content {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-bottom: min(6vh, 58px);
}

.start-menu {
  display: grid;
  justify-items: center;
  gap: 0;
}

.start-menu-button {
  width: min(370px, 72vw);
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0;
  cursor: pointer;
}

.start-menu-button img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.start-message {
  min-height: 22px;
  color: #ffe08a;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.start-message[hidden] {
  display: block;
  visibility: hidden;
}

.settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

.settings-overlay[hidden] {
  display: none;
}

.settings-panel {
  width: min(720px, 94vw);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(226, 181, 84, 0.72);
  border-radius: 8px;
  background: rgba(18, 13, 9, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.72);
  color: #f7e7b7;
}

.settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 181, 84, 0.3);
}

.settings-panel__header h2,
.settings-section h3 {
  margin: 0;
  letter-spacing: 0;
}

.settings-panel__header h2 {
  font-size: 24px;
}

.settings-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(226, 181, 84, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #ffe49a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.settings-section {
  padding: 18px 0 14px;
}

.settings-section h3 {
  margin-bottom: 14px;
  font-size: 14px;
  color: #d9bd78;
}

.settings-backs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  justify-items: center;
}

.settings-back {
  width: 116px;
  height: 170px;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.settings-back img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.settings-back.is-selected {
  border-color: #f0c95f;
  background: rgba(240, 201, 95, 0.12);
  box-shadow: 0 0 18px rgba(240, 201, 95, 0.38);
}

.settings-gameplay {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(226, 181, 84, 0.24);
}

.settings-choice-group {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-choice-group legend {
  float: left;
  width: 110px;
  color: #d9bd78;
  font-size: 12px;
  font-weight: 800;
}

.settings-choice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.settings-choice {
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid rgba(226, 181, 84, 0.35);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: #d8c99e;
  cursor: pointer;
}

.settings-choice strong,
.settings-choice small {
  display: block;
  letter-spacing: 0;
}

.settings-choice strong {
  font-size: 11px;
}

.settings-choice small {
  margin-top: 3px;
  color: #a89566;
  font-size: 10px;
}

.settings-choice.is-selected {
  border-color: #f0c95f;
  background: rgba(73, 98, 42, 0.72);
  color: #fff0ad;
  box-shadow: 0 0 12px rgba(240, 201, 95, 0.24);
}

.settings-choice.is-selected small {
  color: #f4dda0;
}

.settings-audio {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid rgba(226, 181, 84, 0.24);
  border-bottom: 1px solid rgba(226, 181, 84, 0.24);
}

.settings-audio__toggle,
.settings-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
}

.settings-switch {
  position: relative;
  width: 58px;
  height: 30px;
  border: 1px solid rgba(226, 181, 84, 0.55);
  border-radius: 16px;
  background: #34251a;
  color: #d7c18d;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.settings-switch[aria-checked="true"] {
  background: #49622a;
  color: #fff0ad;
}

.settings-volume input {
  width: 100%;
  accent-color: #d4a934;
}

.settings-volume output {
  width: 34px;
  color: #ffe08a;
  text-align: right;
}

.settings-info {
  min-height: 42px;
  padding: 12px 4px 4px;
  color: #e8d9ad;
  font-size: 13px;
  text-align: center;
}

.settings-info[hidden] {
  display: block;
  visibility: hidden;
}

.settings-language-title {
  display: block;
  margin-bottom: 9px;
  color: #d9bd78;
  font-size: 11px;
}

.settings-language-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-language {
  min-height: 38px;
  border: 1px solid rgba(226, 181, 84, 0.35);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: #d8c99e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.settings-language.is-selected {
  border-color: #f0c95f;
  background: rgba(73, 98, 42, 0.72);
  color: #fff0ad;
  box-shadow: 0 0 10px rgba(240, 201, 95, 0.2);
}

.settings-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 8px;
}

.settings-links button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 5px 0;
  color: #bba978;
  font-size: 12px;
  cursor: pointer;
}

.settings-links button:hover,
.settings-links button:focus-visible {
  border-bottom-color: currentColor;
  color: #ffe08a;
}

.settings-legal {
  height: min(560px, calc(100vh - 150px));
  min-height: 360px;
  padding-top: 12px;
}

.settings-legal[hidden],
[data-settings-main][hidden] {
  display: none;
}

.settings-legal__toolbar {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding-bottom: 10px;
}

.settings-legal__back {
  border: 0;
  border-bottom: 1px solid rgba(226, 181, 84, 0.45);
  background: transparent;
  padding: 6px 2px;
  color: #f1cf75;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.settings-legal__back:hover,
.settings-legal__back:focus-visible {
  color: #fff0b0;
  border-bottom-color: currentColor;
}

.settings-legal__frame {
  display: block;
  width: 100%;
  height: calc(100% - 48px);
  border: 1px solid rgba(226, 181, 84, 0.25);
  border-radius: 5px;
  background: #120d09;
}

.tournament-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
}

.tournament-overlay[hidden] {
  display: none;
}

.tournament-panel {
  width: min(940px, 96vw);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px 24px 16px;
  border: 1px solid rgba(226, 181, 84, 0.72);
  border-radius: 8px;
  background: rgba(18, 13, 9, 0.97);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.78);
  color: #f6e5b5;
}

.tournament-overlay.is-character-only .tournament-panel {
  width: min(720px, 96vw);
}

.tournament-overlay.is-character-only .tournament-heading--competition,
.tournament-overlay.is-character-only .tournament-carousel--competition,
.tournament-overlay.is-character-only .tournament-action--play {
  display: none;
}

.tournament-overlay.is-character-only .tournament-actions {
  padding-top: 22px;
}

.tournament-heading {
  margin: 0 0 10px;
  color: #f3cf70;
  font-size: 20px;
  text-align: center;
  letter-spacing: 0;
}

.tournament-heading--competition {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 181, 84, 0.25);
}

.tournament-carousel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
}

.tournament-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(226, 181, 84, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #ffe08a;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.tournament-arrow:hover,
.tournament-arrow:focus-visible {
  border-color: #f3cf70;
  background: rgba(226, 181, 84, 0.13);
}

.tournament-character {
  position: relative;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  width: min(610px, 100%);
  min-height: 142px;
  margin: 0 auto;
  padding: 8px 14px 8px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tournament-character:hover,
.tournament-character:focus-visible {
  border-color: rgba(226, 181, 84, 0.4);
  background: rgba(226, 181, 84, 0.05);
}

.tournament-character.is-selected {
  border-color: rgba(255, 218, 113, 0.72);
  background: rgba(131, 101, 36, 0.13);
  box-shadow: inset 0 0 24px rgba(255, 207, 80, 0.11), 0 0 16px rgba(255, 195, 59, 0.16);
}

.tournament-character img {
  display: block;
  width: 142px;
  height: 142px;
  object-fit: contain;
}

.tournament-character.is-selected img {
  filter: brightness(1.09) drop-shadow(0 0 16px rgba(255, 207, 80, 0.68));
}

.tournament-character__copy h3,
.tournament-choice__copy h3 {
  margin: 0 0 7px;
  color: #fff0b0;
  font-size: 21px;
  letter-spacing: 0;
}

.tournament-character__copy p {
  max-width: 440px;
  margin: 0 0 9px;
  color: #d8c99f;
  font-size: 14px;
  line-height: 1.4;
}

.tournament-character__selected {
  display: inline-block;
  margin: 0 10px 7px 0;
  color: #ffe08a;
  font-size: 11px;
}

.tournament-character__selected[hidden] {
  display: none;
}

.tournament-counter {
  color: #a99562;
  font-size: 11px;
  font-weight: 800;
}

.tournament-choice {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(210px, 1fr);
  align-items: stretch;
  gap: 18px;
  width: min(750px, 100%);
  min-height: 156px;
  margin: 0 auto;
}

.tournament-choice__media {
  position: relative;
  min-height: 156px;
  overflow: hidden;
  border: 1px solid rgba(226, 181, 84, 0.42);
  border-radius: 6px;
  background: #080604;
}

.tournament-choice__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 156px;
  object-fit: cover;
}

.tournament-rival {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 4px 10px 4px 4px;
  border: 1px solid rgba(239, 204, 111, 0.55);
  border-radius: 28px;
  background: rgba(10, 7, 4, 0.84);
  color: #ffe8a5;
  font-size: 11px;
  font-weight: 900;
}

.tournament-rival img {
  width: 44px;
  height: 44px;
  min-height: 0;
  flex: 0 0 44px;
  border-radius: 50%;
  object-fit: cover;
}

.tournament-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  background: rgba(5, 4, 3, 0.62);
  color: #e8d8ac;
  font-size: 14px;
  font-weight: 900;
}

.tournament-lock[hidden] {
  display: none;
}

.tournament-choice__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tournament-choice__copy dl {
  margin: 0 0 8px;
}

.tournament-choice__copy dl div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 3px 0;
}

.tournament-choice__copy dt {
  color: #aa9764;
  font-size: 12px;
}

.tournament-choice__copy dd {
  min-width: 0;
  margin: 0;
  color: #f1db99;
  font-size: 12px;
  font-weight: 800;
}

.tournament-choice__copy dd.is-locked {
  color: #b58c7d;
}

.tournament-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 16px;
}

.tournament-action {
  width: 180px;
  height: 58px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.tournament-action img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tournament-action:hover:not(:disabled),
.tournament-action:focus-visible:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-2px);
}

.tournament-action:disabled {
  cursor: not-allowed;
  filter: grayscale(0.9);
  opacity: 0.42;
}

.tournament-action[hidden] {
  display: none;
}

.mano-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.84);
}

.mano-overlay[hidden] {
  display: none;
}

.mano-panel {
  position: relative;
  width: min(62.5vh, 94vw, 600px);
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.mano-panel__frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.mano-close {
  position: absolute;
  top: 3.8%;
  right: 6.8%;
  width: 11.5%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.mano-close:hover,
.mano-close:focus-visible {
  outline: 2px solid rgba(255, 226, 137, 0.9);
  outline-offset: 2px;
  box-shadow: 0 0 18px rgba(255, 199, 61, 0.7);
}

.mano-player {
  position: absolute;
  top: 20.1%;
  left: 35%;
  width: 30%;
  height: 23.5%;
  display: grid;
  place-items: center;
}

.mano-player img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 210, 90, 0.42));
}

.mano-reel {
  position: absolute;
  top: 56.7%;
  left: 9.5%;
  width: 81%;
  height: 24.8%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mano-reel__item {
  flex: 0 0 20%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 0.46;
  transform: scale(0.64);
  transition: transform 100ms ease, opacity 100ms ease, filter 100ms ease;
}

.mano-reel__item--near {
  opacity: 0.72;
  transform: scale(0.84);
}

.mano-reel__item--center {
  z-index: 2;
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 0 12px rgba(255, 210, 89, 0.85));
}

.mano-reel__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mano-reel.is-rolling .mano-reel__item {
  animation: manoReelShift 110ms ease both;
}

.mano-play {
  position: absolute;
  left: 28%;
  bottom: 2.2%;
  width: 44%;
  height: 8.5%;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}

.mano-play:disabled {
  background: rgba(0, 0, 0, 0.52);
  cursor: wait;
}

.mano-play:not(:disabled) {
  box-shadow: 0 0 20px rgba(255, 207, 74, 0.5);
}

.mano-play:not(:disabled):hover,
.mano-play:not(:disabled):focus-visible {
  outline: 2px solid #ffe08a;
  outline-offset: 2px;
  box-shadow: 0 0 28px rgba(255, 207, 74, 0.78);
}

@keyframes manoReelShift {
  from {
    translate: 16% 0;
    opacity: 0.35;
  }
  to {
    translate: 0 0;
  }
}

@media (max-width: 700px) {
  .tournament-overlay {
    padding: 8px;
  }

  .tournament-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px 10px 12px;
  }

  .tournament-heading {
    font-size: 17px;
  }

  .tournament-carousel {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 5px;
  }

  .tournament-arrow {
    width: 40px;
    height: 48px;
  }

  .tournament-character {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    min-height: 108px;
  }

  .tournament-character img {
    width: 108px;
    height: 108px;
  }

  .tournament-character__copy h3,
  .tournament-choice__copy h3 {
    font-size: 17px;
  }

  .tournament-character__copy p {
    font-size: 12px;
  }

  .tournament-choice {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
  }

  .tournament-choice__media,
  .tournament-choice__media img {
    min-height: 112px;
    height: 112px;
  }

  .tournament-rival {
    left: 6px;
    bottom: 5px;
    padding: 3px 8px 3px 3px;
    font-size: 10px;
  }

  .tournament-rival img {
    width: 36px;
    height: 36px;
    min-height: 0;
    flex-basis: 36px;
  }

  .tournament-choice__copy {
    padding: 0 4px;
  }

  .tournament-choice__copy h3 {
    margin-bottom: 3px;
  }

  .tournament-choice__copy dl {
    margin-bottom: 3px;
  }

  .tournament-choice__copy dl div {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 1px 0;
  }

  .tournament-actions {
    gap: 8px;
    padding-top: 10px;
  }

  .tournament-action {
    width: min(150px, 42vw);
    height: 50px;
  }
}

.intro-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  z-index: 50;
}

.intro-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at center,
      rgba(255, 190, 90, 0.08),
      rgba(0, 0, 0, 0) 46%
    ),
    #050505;
}

.intro-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-logo {
  position: absolute;
  max-width: min(1180px, 92vw);
  max-height: 82vh;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
}

.intro-pucara {
  max-width: min(620px, 78vw);
  max-height: 42vh;
  animation: introLogoOne 2s ease forwards;
}

.intro-presentacion {
  animation: introLogoTwo 3.2s ease forwards;
  animation-delay: 1.8s;
}

.intro-exit {
  animation: introExit 520ms ease forwards;
}

@keyframes introLogoOne {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }

  18%,
  72% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes introLogoTwo {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }

  18%,
  78% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes introExit {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.table-screen {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 16px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  contain: layout paint;
}

.table-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.table-screen > * {
  position: relative;
  z-index: 1;
}

.table-back {
  position: absolute;
  top: 62px;
  right: 22px;
  z-index: 8;
  width: min(118px, 16vw);
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0;
  cursor: pointer;
}

.table-back img {
  display: block;
  width: 100%;
  height: auto;
}

.table-screen__hud,
.table-screen__played,
.table-screen__hand {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.42);
  border-radius: 8px;
  backdrop-filter: blur(2px);
}

.table-screen__hud {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  font-weight: 700;
}

.table-screen__message {
  min-height: 28px;
  padding: 6px 10px;
  color: #ffe08a;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
}

.table-screen__message[hidden] {
  display: block;
  visibility: hidden;
}

.table-screen__body {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 178px;
  gap: 4px;
  min-height: 0;
  overflow: visible;
}

.table-deck {
  position: absolute;
  left: 29%;
  top: 48%;
  width: 88px;
  height: 132px;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -50%) perspective(520px) rotateX(52deg) rotateZ(-7deg) skewX(-2deg);
  transform-origin: center bottom;
  filter: drop-shadow(0 18px 10px rgba(0, 0, 0, 0.62));
}

.table-deck__card,
.table-deck__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

.table-deck__card {
  border: 1px solid rgba(245, 225, 175, 0.72);
  background: #e8dfca;
}

.table-deck__card--back {
  transform: translate(-7px, 7px);
}

.table-deck__card--middle {
  transform: translate(-3px, 3px);
}

.table-deck__card--base {
  transform: translate(-10px, 10px);
  background: #cfc4aa;
}

.table-deck__image {
  object-fit: contain;
  border: 1px solid rgba(245, 225, 175, 0.8);
  background: #eee7d8;
}

.table-deal-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: visible;
  pointer-events: none;
}

.table-deal-card {
  position: absolute;
  width: 78px;
  height: 118px;
  object-fit: contain;
  border: 1px solid rgba(245, 225, 175, 0.82);
  border-radius: 6px;
  background: #eee7d8;
  box-shadow: 0 15px 18px rgba(0, 0, 0, 0.48);
  opacity: 0;
  transform-origin: center;
  animation: table-deal-card 520ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

.table-deal-card--opponent {
  filter: brightness(0.88);
}

.table-screen__body.is-dealing .table-screen__hand {
  opacity: 0;
}

@keyframes table-deal-card {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) perspective(520px) rotateX(52deg) rotateZ(-7deg) scale(0.92);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--deal-x)), calc(-50% + var(--deal-y))) perspective(520px) rotateX(34deg) rotateZ(var(--deal-rotate)) scale(1);
  }
}

.table-screen__players {
  position: absolute;
  inset: 0;
  padding: 0;
  pointer-events: none;
  z-index: 3;
}

.table-player {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.table-player:nth-child(1) {
  top: 16px;
}

.table-player:nth-child(2) {
  bottom: 16px;
}

.table-player[data-active-turn="true"] {
  outline: 0;
}

.table-player__avatar {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 50%;
  filter:
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75))
    drop-shadow(0 0 0 rgba(255, 224, 138, 0));
}

.table-player[data-active-turn="true"] .table-player__avatar {
  filter:
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75))
    drop-shadow(0 0 14px rgba(255, 224, 138, 0.82));
}

.table-score-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.score-marker {
  position: absolute;
  right: 22px;
  display: grid;
  justify-items: end;
  gap: 7px;
  width: 250px;
  color: #ffe08a;
  text-align: right;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.86);
}

.score-marker--opponent {
  top: 116px;
}

.score-marker--local {
  bottom: 82px;
}

.score-marker__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 224, 138, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 24, 9, 0.74), rgba(0, 0, 0, 0.56));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.score-marker__label,
.score-marker__phase {
  text-transform: uppercase;
}

.score-marker__number {
  min-width: 18px;
  color: #ffffff;
  text-align: center;
}

.score-marker__beans {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-height: 62px;
}

.score-bean-pile {
  position: relative;
  display: block;
  width: 76px;
  height: 58px;
}

.score-bean-pile[data-count="0"] {
  opacity: 0;
}

.score-bean {
  position: absolute;
  width: 34px;
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 5px 5px rgba(0, 0, 0, 0.82))
    drop-shadow(0 0 7px rgba(255, 210, 110, 0.2));
}

.score-bean--1 {
  left: 0;
  bottom: 3px;
  transform: rotate(-17deg);
}

.score-bean--2 {
  left: 14px;
  bottom: 0;
  transform: rotate(8deg);
}

.score-bean--3 {
  left: 28px;
  bottom: 3px;
  transform: rotate(-7deg);
}

.score-bean--4 {
  left: 42px;
  bottom: 0;
  transform: rotate(15deg);
}

.score-bean--5 {
  left: 21px;
  bottom: 25px;
  transform: rotate(-2deg);
}

.table-screen__played {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: stretch;
  justify-content: stretch;
  gap: 12px;
  min-height: 210px;
  padding: 18px 12px;
  backdrop-filter: none;
  perspective: 520px;
  perspective-origin: 50% 28%;
  overflow: visible;
}

.table-played-lane {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 94px;
  pointer-events: none;
  overflow: visible;
}

.table-played-lane--opponent {
  align-items: end;
}

.table-played-lane--local {
  align-items: start;
}

.table-screen__hand {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px 34px;
  min-height: 178px;
  transform: translateY(-34px);
  perspective: 520px;
  perspective-origin: 50% 0%;
  overflow: visible;
}

.table-card,
.table-played-card {
  width: 96px;
  height: 146px;
  min-height: 146px;
  display: grid;
  place-items: center;
  padding: 0px;
  border: 0;
  border-radius: 8px;
  background: #f7f3e8;
  color: #111;
  font-weight: 700;
  cursor: pointer;
  transform-style: preserve-3d;
  overflow: visible;
}

.table-card[data-selected="true"] {
  z-index: 5;
  box-shadow:
    0 0 0 4px #ffe08a,
    0 26px 34px rgba(0, 0, 0, 0.48),
    0 0 24px rgba(255, 224, 138, 0.78);
}

.table-card img,
.table-played-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.table-card span,
.table-played-card span {
  display: block;
  width: 100%;
  height: 100%;
  text-align: center;
  overflow: visible;
}

.table-played-card {
  cursor: default;
  box-shadow: 0 20px 16px rgba(0, 0, 0, 0.38);
}

.table-played-card[data-table-side="opponent"] {
  transform: rotateX(56deg) scale(0.82) translateY(12px);
  transform-origin: center bottom;
}

.table-played-card[data-table-side="local"] {
  transform: rotateX(42deg) scale(0.94) translateY(-6px);
  transform-origin: center top;
}

.table-card {
  box-shadow: 0 18px 14px rgba(0, 0, 0, 0.34);
}

.table-card:nth-child(1) {
  transform: rotateX(34deg) rotateZ(-3deg) translateY(8px);
  transform-origin: center top;
}

.table-card:nth-child(2) {
  transform: rotateX(38deg) translateY(3px);
  transform-origin: center top;
}

.table-card:nth-child(3) {
  transform: rotateX(34deg) rotateZ(3deg) translateY(8px);
  transform-origin: center top;
}
.table-card:nth-child(1)[data-selected="true"] {
  transform: rotateX(30deg) rotateZ(-3deg) translateY(-24px) scale(1.06);
}

.table-card:nth-child(2)[data-selected="true"] {
  transform: rotateX(34deg) translateY(-28px) scale(1.06);
}

.table-card:nth-child(3)[data-selected="true"] {
  transform: rotateX(30deg) rotateZ(3deg) translateY(-24px) scale(1.06);
}
.table-screen__actions {
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 58px;
  margin-top: -42px;
  z-index: 6;
}

.table-call-trigger,
.table-call-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.table-call-trigger:disabled,
.table-card:disabled {
  cursor: default;
  pointer-events: none;
}

.table-call-trigger:disabled {
  opacity: 0.72;
}

.table-card:disabled {
  filter: brightness(0.86);
}

.table-call-trigger {
  width: min(218px, 46vw);
  align-self: end;
}

.table-call-trigger img,
.table-call-button img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  filter: none;
  image-rendering: auto;
}

.table-call-overlay {
  position: absolute;
  top: auto;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 32px));
  height: 276px;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
  z-index: 7;
}

.table-call-overlay[hidden] {
  display: none;
}

.table-call-button {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(140px, 22vw);
  min-width: 0;
  min-height: 0;
  line-height: 0;
  opacity: 1;
  filter: none;
  box-shadow: none;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--fan-x, 0px)), var(--fan-y, -190px));
}

.table-call-button img {
  width: 100%;
  max-height: none;
  object-fit: contain;
  opacity: 1;
  filter: none;
}

@media (max-width: 700px) {
  .settings-overlay {
    padding: 8px;
  }

  .settings-panel {
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .settings-panel__header h2 {
    font-size: 19px;
  }

  .settings-backs {
    gap: 8px;
  }

  .settings-back {
    width: min(94px, 27vw);
    height: min(138px, 40vw);
  }

  .settings-audio {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .settings-choice-group {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .settings-choice-group legend {
    float: none;
    width: auto;
  }

  .settings-choice-row {
    gap: 5px;
  }

  .settings-volume {
    display: grid;
    grid-template-columns: auto 1fr 30px;
  }

  .table-screen {
    padding: 8px;
  }

  .table-back {
    top: 50px;
    right: 10px;
    width: min(96px, 25vw);
  }

  .table-card,
  .table-played-card {
    width: 78px;
    height: 120px;
    min-height: 120px;
  }

  .table-screen__played {
    gap: 8px;
    min-height: 196px;
    padding: 14px 8px;
  }

  .table-played-lane {
    gap: 10px;
    min-height: 82px;
  }

  .table-screen__hand {
    min-height: 148px;
    padding: 8px 8px 28px;
    transform: translateY(-28px);
  }

  .table-screen__body {
    grid-template-rows: minmax(0, 1fr) 148px;
  }

  .table-deck {
    left: 24%;
    top: 46%;
    width: 62px;
    height: 94px;
  }

  .table-deal-card {
    width: 62px;
    height: 94px;
  }

  .table-screen__players {
    left: 0;
  }

  .table-player {
    left: 8px;
    width: 64px;
    height: 64px;
  }

  .table-player:nth-child(1) {
    top: 8px;
  }

  .table-player:nth-child(2) {
    bottom: 8px;
  }

  .table-player__avatar {
    width: 64px;
    height: 64px;
  }

  .score-marker {
    right: 2px;
    width: 174px;
  }

  .score-marker--opponent {
    top: 100px;
  }

  .score-marker--opponent .score-marker__beans {
    justify-self: end;
    transform: translateX(8px);
  }

  .score-marker--local {
    bottom: clamp(150px, 25vh, 210px);
  }

  .score-marker__meta {
    font-size: 10px;
    padding: 4px 7px;
  }

  .score-marker__beans {
    gap: 2px;
    min-height: 43px;
  }

  .score-bean-pile {
    width: 54px;
    height: 42px;
  }

  .score-bean {
    width: 24px;
  }

  .score-bean--2 {
    left: 10px;
  }

  .score-bean--3 {
    left: 20px;
  }

  .score-bean--4 {
    left: 30px;
  }

  .score-bean--5 {
    left: 15px;
    bottom: 18px;
  }

  .table-call-overlay {
    bottom: max(0px, env(safe-area-inset-bottom));
    width: min(100vw, 420px);
    height: 238px;
  }

  .table-call-button {
    width: min(96px, 27vw);
    min-width: 0;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.58));
  }

  .table-call-button img {
    max-height: none;
  }

  .table-call-trigger {
    width: min(178px, 48vw);
  }

  .table-screen__actions {
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }

  .table-screen.is-call-menu-open .table-screen__hand {
    opacity: 0.16;
    transition: opacity 120ms ease;
  }

  .table-screen.is-call-menu-open .table-call-trigger {
    filter: drop-shadow(0 0 9px rgba(255, 214, 96, 0.42));
  }

  .table-screen__hud,
  .table-screen__hand {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .table-deck {
    filter: drop-shadow(0 9px 6px rgba(0, 0, 0, 0.5));
  }

  .table-card,
  .table-played-card {
    box-shadow: 0 9px 8px rgba(0, 0, 0, 0.34);
  }

  .table-card[data-selected="true"] {
    box-shadow:
      0 0 0 2px #ffe08a,
      0 12px 14px rgba(0, 0, 0, 0.42);
  }

  .table-player__avatar {
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7));
  }

  .table-player[data-active-turn="true"] .table-player__avatar {
    filter:
      drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7))
      drop-shadow(0 0 7px rgba(255, 224, 138, 0.72));
  }

  .score-bean {
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.72));
  }

  .table-deal-card {
    backface-visibility: hidden;
    will-change: transform, opacity;
    box-shadow: 0 8px 9px rgba(0, 0, 0, 0.4);
  }

  .table-call-button {
    backface-visibility: hidden;
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* CHINCHON TABLE */
.chinchon-table {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background-color: #17120d;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.chinchon-table__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(6, 9, 8, 0.68), rgba(8, 6, 4, 0.14) 32%, rgba(4, 7, 6, 0.58));
}

.chinchon-hud {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 10px 7px 16px;
  border: 1px solid rgba(230, 194, 91, 0.48);
  border-radius: 6px;
  background: rgba(6, 9, 8, 0.84);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}

.chinchon-hud__score {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: #f0d681;
}

.chinchon-hud__score--opponent {
  justify-content: flex-end;
}

.chinchon-hud__score span,
.chinchon-hud__round {
  font-size: 12px;
  font-weight: 900;
  color: #b9d8c0;
}

.chinchon-hud__score strong {
  font-size: 25px;
}

.chinchon-hud__score i {
  font-size: 11px;
  font-style: normal;
  color: #b7a978;
}

.chinchon-hud__round {
  padding: 7px 10px;
  color: #f4dd91;
}

.chinchon-back {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #cba94f;
  border-radius: 5px;
  color: #f5dc8b;
  background: #22190e;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.chinchon-board {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(94px, 0.27fr) minmax(150px, 0.42fr) minmax(128px, 0.31fr);
}

.chinchon-seat {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  transition: opacity 280ms ease, filter 280ms ease;
}

.chinchon-seat.is-waiting {
  opacity: 0.52;
  filter: saturate(0.72) brightness(0.8);
}

.chinchon-seat.is-turn {
  opacity: 1;
  filter: none;
}

.chinchon-seat.is-turn .chinchon-player img {
  filter: drop-shadow(0 0 10px rgba(223, 190, 82, 0.72)) drop-shadow(0 7px 8px rgba(0, 0, 0, 0.65));
}

.chinchon-player {
  position: absolute;
  left: 2px;
  top: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f6e5ae;
}

.chinchon-seat--human .chinchon-player {
  top: auto;
  bottom: 6px;
}

.chinchon-player img {
  width: clamp(62px, 7vw, 96px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.65));
}

.chinchon-player div {
  display: grid;
  gap: 3px;
  padding: 6px 9px;
  border-left: 2px solid #d0ad54;
  background: rgba(6, 9, 8, 0.68);
}

.chinchon-player strong {
  font-size: 12px;
}

.chinchon-player span {
  color: #92bea0;
  font-size: 10px;
  font-weight: 900;
}

.chinchon-player b {
  color: #f2d77e;
  font-size: 13px;
}

.chinchon-opponent-hand,
.chinchon-human-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}

.chinchon-opponent-hand .chinchon-card {
  width: clamp(38px, 4vw, 62px);
  margin-left: clamp(-25px, -1.5vw, -14px);
  transform: rotateX(18deg) rotate(calc((var(--card-index) - 3) * 2deg));
  transform-origin: 50% 115%;
}

.chinchon-opponent-hand .chinchon-card:first-child {
  margin-left: 0;
}

.chinchon-center {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(78px, 0.7fr) minmax(170px, 1.5fr) minmax(78px, 0.7fr);
  align-items: center;
  justify-items: center;
  gap: clamp(18px, 5vw, 90px);
  width: min(780px, 72vw);
  margin: auto;
  padding: 10px 22px;
  border-block: 1px solid rgba(224, 193, 102, 0.22);
  background: rgba(8, 12, 10, 0.2);
}

.chinchon-pile,
.chinchon-discard {
  border: 0;
  background: transparent;
  padding: 0;
  color: #ead48d;
  cursor: pointer;
}

.chinchon-pile:disabled,
.chinchon-discard:disabled {
  cursor: default;
}

.chinchon-pile__stack {
  position: relative;
  display: block;
  width: clamp(66px, 6.4vw, 96px);
  aspect-ratio: 0.58;
  transform: perspective(520px) rotateY(-13deg) rotateX(8deg);
}

.chinchon-discard__stack {
  position: relative;
  z-index: 0;
  display: block;
  width: clamp(66px, 6.4vw, 96px);
  aspect-ratio: 0.58;
}

.chinchon-discard__stack::before,
.chinchon-discard__stack::after {
  content: "";
  position: absolute;
  inset: 5px -6px -6px 5px;
  z-index: -2;
  border: 2px solid #d8d0ba;
  border-radius: 6px;
  background: #8f8672;
  transform: rotate(2deg);
  box-shadow: 7px 9px 13px rgba(0, 0, 0, 0.42);
}

.chinchon-discard__stack::after {
  inset: 2px -3px -3px 2px;
  z-index: -1;
  transform: rotate(-1.5deg);
  background: #b0a690;
}

.chinchon-pile__stack::before,
.chinchon-pile__stack::after {
  content: "";
  position: absolute;
  inset: 4px -5px -5px 4px;
  border: 2px solid #e7dfc6;
  border-radius: 6px;
  background: #aea58f;
  box-shadow: 9px 11px 15px rgba(0, 0, 0, 0.48);
}

.chinchon-pile__stack::after {
  inset: 2px -2px -2px 2px;
}

.chinchon-pile__stack img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid #f4efde;
  border-radius: 6px;
}

.chinchon-pile small,
.chinchon-discard small {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 900;
}

.chinchon-pile:not(:disabled):hover .chinchon-pile__stack,
.chinchon-discard:not(:disabled):hover .chinchon-card {
  transform: translateY(-8px) scale(1.04);
}

.chinchon-center__message {
  max-width: 270px;
  padding: 9px 15px;
  border: 1px solid rgba(174, 210, 184, 0.4);
  border-radius: 5px;
  color: #f7e3a0;
  background: rgba(5, 12, 9, 0.78);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.chinchon-center__message.is-hidden {
  visibility: hidden;
}

.chinchon-card {
  display: block;
  width: 100%;
  aspect-ratio: 0.58;
  object-fit: cover;
  border: 3px solid #f3eee0;
  border-radius: 6px;
  box-shadow: 0 9px 13px rgba(0, 0, 0, 0.4);
  transition: transform 150ms ease, filter 150ms ease;
}

.chinchon-card--discard {
  width: clamp(66px, 6.4vw, 96px);
}

.chinchon-card--back {
  object-fit: cover;
}

.chinchon-empty-card {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 0.58;
  border: 1px dashed rgba(240, 220, 160, 0.5);
  color: #a9986c;
}

.chinchon-human-hand {
  align-self: start;
  padding-top: 5px;
  transform: translateY(-26px);
}

.chinchon-hand-card {
  position: relative;
  width: clamp(56px, 8vw, 104px);
  flex: 0 0 auto;
  margin-left: clamp(-10px, -0.3vw, -3px);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: perspective(850px) rotateX(8deg) rotate(calc((var(--card-index) - 3.5) * 1.7deg));
  transform-origin: 50% 118%;
  transition: transform 160ms ease, margin 160ms ease, opacity 120ms ease, z-index 0ms;
}

.chinchon-hand-card:first-child {
  margin-left: 0;
}

.chinchon-hand-card:not(:disabled):hover,
.chinchon-hand-card.is-selected {
  z-index: 12;
  transform: perspective(850px) rotateX(3deg) translateY(-20px) scale(1.06);
}

.chinchon-hand-card.is-selected .chinchon-card {
  border-color: #bde7c7;
  filter: drop-shadow(0 0 9px rgba(112, 220, 139, 0.9));
}

.chinchon-hand-card.is-run .chinchon-card {
  border-color: #69b7ff;
  filter: drop-shadow(0 0 7px rgba(70, 160, 255, 0.72));
}

.chinchon-hand-card.is-set .chinchon-card {
  border-color: #74d58a;
  filter: drop-shadow(0 0 7px rgba(77, 202, 104, 0.72));
}

.chinchon-hand-card.is-selected .chinchon-card {
  border-color: #fff2a8;
  filter: drop-shadow(0 0 10px rgba(255, 222, 95, 0.95));
}

.chinchon-hand-card.is-dragging {
  z-index: 20;
  opacity: 0.94;
  cursor: grabbing;
  pointer-events: none;
  transform: translate(var(--drag-x, 0), var(--drag-y, 0)) translateY(-18px) scale(1.08) !important;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.58));
}

.chinchon-hand-card img {
  -webkit-user-drag: none;
  user-select: none;
}

.chinchon-hand-card.is-drop-before {
  margin-left: 18px;
}

.chinchon-hand-card.is-drop-after {
  margin-right: 22px;
}

.chinchon-actions {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid rgba(228, 196, 101, 0.38);
  background: rgba(5, 9, 7, 0.84);
  color: #e8d58e;
  font-size: 11px;
  font-weight: 900;
}

.chinchon-actions--quiet {
  min-height: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.chinchon-actions button,
.chinchon-result button {
  min-height: 40px;
  padding: 0 22px;
  border: 1px solid #dfc264;
  border-radius: 5px;
  color: #fff1b6;
  background: #25492d;
  font-weight: 900;
  cursor: pointer;
}

.chinchon-actions button[data-pass] {
  background: #29251b;
}

.chinchon-actions button:disabled {
  opacity: 0.38;
  cursor: default;
}

.chinchon-thinking {
  animation: chinchon-thinking 900ms ease-in-out infinite alternate;
}

@keyframes chinchon-thinking {
  to { opacity: 0.45; }
}

.chinchon-result {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 5, 0.72);
  overflow: hidden;
}

.chinchon-result__panel {
  position: relative;
  z-index: 2;
  width: min(440px, 92vw);
  padding: 28px;
  border: 1px solid #d7b957;
  border-radius: 7px;
  color: #f7e7ae;
  background: #111713;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.68);
  text-align: center;
}

.chinchon-confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.chinchon-confetti i {
  position: absolute;
  top: -24px;
  left: var(--left);
  width: 9px;
  height: 15px;
  border-radius: var(--shape);
  background: var(--color);
  box-shadow: 0 0 6px color-mix(in srgb, var(--color) 55%, transparent);
  animation: chinchon-confetti-fall var(--duration) linear var(--delay) infinite;
  will-change: transform;
}

@keyframes chinchon-confetti-fall {
  0% {
    transform: translate3d(0, -24px, 0) rotate(0deg);
  }

  100% {
    transform: translate3d(var(--drift), 112vh, 0) rotate(760deg);
  }
}

.chinchon-result h2 {
  margin: 0 0 14px;
  font-size: 24px;
  letter-spacing: 0;
}

.chinchon-result__chinchon {
  margin: 0 0 12px;
  color: #9ee0ad;
  font-size: 28px;
  font-weight: 900;
}

.chinchon-result__scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.chinchon-result__scores span {
  padding: 12px;
  border: 1px solid rgba(217, 188, 94, 0.32);
  background: #1d251f;
}

.chinchon-result__scores strong {
  display: block;
  margin-top: 5px;
  font-size: 26px;
}

.chinchon-result__buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.app-error {
  margin: 0;
  min-height: 100%;
  padding: 24px;
  color: #ffd6d6;
  background: #270d0d;
  white-space: pre-wrap;
}

@media (max-width: 700px) {
  .chinchon-table {
    padding: max(5px, env(safe-area-inset-top)) max(5px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left));
  }

  .chinchon-hud {
    min-height: 48px;
    gap: 5px;
    padding: 5px 6px;
  }

  .chinchon-hud__score {
    gap: 4px;
  }

  .chinchon-hud__score strong {
    font-size: 18px;
  }

  .chinchon-hud__score i,
  .chinchon-hud__round {
    font-size: 8px;
  }

  .chinchon-hud__round {
    padding: 5px;
    font-size: 9px;
  }

  .chinchon-back {
    min-height: 30px;
    padding: 0 8px;
    font-size: 8px;
  }

  .chinchon-board {
    grid-template-rows: minmax(80px, 0.24fr) minmax(150px, 0.43fr) minmax(118px, 0.33fr);
  }

  .chinchon-player {
    top: 4px;
    gap: 4px;
  }

  .chinchon-seat--human .chinchon-player {
    bottom: 2px;
  }

  .chinchon-player img {
    width: 54px;
  }

  .chinchon-player div {
    padding: 4px 5px;
  }

  .chinchon-player strong {
    display: none;
  }

  .chinchon-player b {
    font-size: 11px;
  }

  .chinchon-center {
    width: 84vw;
    grid-template-columns: 58px minmax(98px, 1fr) 58px;
    gap: 9px;
    padding: 7px 5px;
  }

  .chinchon-pile__stack,
  .chinchon-discard__stack,
  .chinchon-card--discard {
    width: 54px;
  }

  .chinchon-center__message {
    padding: 7px 5px;
    font-size: 9px;
  }

  .chinchon-pile small,
  .chinchon-discard small {
    margin-top: 4px;
    font-size: 8px;
  }

  .chinchon-opponent-hand .chinchon-card {
    width: 36px;
    margin-left: -17px;
  }

  .chinchon-human-hand {
    transform: translateY(-18px);
  }

  .chinchon-hand-card {
    width: 54px;
    margin-left: -13px;
  }

  .chinchon-hand-card:not(:disabled):hover,
  .chinchon-hand-card.is-selected {
    transform: translateY(-13px) scale(1.04);
  }

  .chinchon-actions {
    min-height: 52px;
    gap: 6px;
  }

  .chinchon-actions button,
  .chinchon-result button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .chinchon-hand-card {
    width: 52px;
    margin-left: -14px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .chinchon-board {
    grid-template-rows: 0.22fr 0.43fr 0.35fr;
  }

  .chinchon-player img {
    width: 52px;
  }

  .chinchon-human-hand {
    transform: scale(0.82);
    transform-origin: top center;
  }

  .chinchon-opponent-hand {
    transform: scale(0.78);
  }
}
