@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --felt: #15201c;
  --felt-2: #1c2b25;
  --card-face: #f7f2e4;
  --red: #e8384f;
  --yellow: #f2b705;
  --green: #279c4b;
  --blue: #2266d1;
  --purple: #7c3fa8;
  --orange: #e8792f;
  --pink: #e85b9b;
  --teal: #1b9a93;
  --curinga: #2a2a2a;
  --ok: #2fa84f;
  --mid: #d99a06;
  --bad: #4a4a4a;
  --gold: #f2b705;
  --paper: #efe7d3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--paper);
  min-height: 100%;
  padding: 28px 16px 60px;

  background-color: var(--felt);
  background-image:
    radial-gradient(ellipse at 50% -10%, #24382f 0%, transparent 65%), radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.012) 50%, transparent 50%), linear-gradient(90deg, rgba(0, 0, 0, 0.015) 50%, transparent 50%);

  background-size:
    100% 100%,
    100% 100%,
    3px 3px,
    2px 2px;
}

.wrap {
  max-width: 800px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 44px;
  letter-spacing: 1px;
}
.tagline {
  font-size: 14px;
  color: #a9baaf;
  margin-top: 6px;
}
.tagline b {
  color: var(--paper);
}
.unodle-logo-img {
  height: 125px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
}

.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: #7d9186;
}
.version-tag {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.5px;
}

.menu-wrap {
  position: relative;
}
.icon-btn {
  background: none;
  border: 1px solid #3a5147;
  color: #a9baaf;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--felt-2);
  border: 2px solid #33473c;
  border-radius: 10px;
  min-width: 190px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  z-index: 60;
  overflow: hidden;
}
.dropdown-menu.show {
  display: block;
}
.menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--paper);
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}
.menu-item:hover {
  background: #24352e;
}
.menu-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.menu-item:disabled:hover {
  background: none;
}

.menu-confirm {
  padding: 10px 14px;
  font-size: 12px;
  color: #a9baaf;
}
.menu-confirm-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.confirm-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a9baaf;
}
.confirm-text {
  white-space: nowrap;
}
.confirm-btn {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
}
.confirm-btn.yes {
  background: var(--red);
  color: #fff;
}
.confirm-btn.yes:hover {
  background: #ff4a62;
}
.confirm-btn.no {
  background: none;
  border: 1px solid #3a5147;
  color: #a9baaf;
}
.confirm-btn.no:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.banner {
  display: none;
  margin-bottom: 20px;
  position: relative;
  background: linear-gradient(165deg, #24352e 0%, var(--felt-2) 60%, var(--felt) 100%);
  border: 1px solid rgba(242, 183, 5, 0.35);
  color: var(--paper);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(242, 183, 5, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(242, 183, 5, 0.06);
  font-family: "Baloo 2", sans-serif;
  overflow: hidden;
}
.banner::before {
  content: "";
  position: absolute;
  top: -60%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(242, 183, 5, 0.25) 0%, transparent 70%);
  pointer-events: none;
}
.banner.show {
  display: block;
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.banner h2 {
  margin: 0 0 6px;
  font-size: 23px;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(242, 183, 5, 0.3);
  position: relative;
}
.banner p {
  margin: 0;
  font-family: "Inter";
  font-weight: 500;
  font-size: 14px;
  color: #a9baaf;
  position: relative;
}
.banner .secret-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(242, 183, 5, 0.25);
  border-radius: 10px;
  padding: 7px 14px;
  font-family: "Inter";
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  position: relative;
}
.banner .newgame-wrap {
  margin-top: 16px;
  position: relative;
}
.banner .newgame {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  padding: 8px 18px;
}
.banner .newgame:hover {
  background: rgba(242, 183, 5, 0.12);
}
.banner .confirm-text {
  color: #a9baaf;
}
.banner .confirm-btn.yes {
  background: var(--ok);
  color: #fff;
}
.banner .confirm-btn.yes:hover {
  background: #37b85c;
}
@keyframes pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search-wrap input {
  width: 100%;
  background: var(--felt-2);
  border: 2px solid #33473c;
  color: var(--paper);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-family: "Inter", sans-serif;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--gold);
}

.suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--felt-2);
  border: 2px solid #33473c;
  border-radius: 12px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.suggestions.show {
  display: block;
}
.suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #263832;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item:hover,
.suggestion-item:active,
.suggestion-item.active {
  background: #24352e;
}
.sugg-name {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--paper);
  margin-bottom: 5px;
}
.sugg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sugg-chip {
  font-size: 10.5px;
  color: #a9baaf;
  background: var(--felt);
  border-radius: 6px;
  padding: 3px 7px;
  line-height: 1.4;
}
.sugg-chip b {
  color: #c9d6cc;
  font-weight: 600;
}
.suggestion-empty {
  padding: 14px;
  text-align: center;
  color: #7d9186;
  font-size: 13px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #8fa398;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}
.meta-row .count {
  font-family: "JetBrains Mono", monospace;
  color: var(--gold);
}
.newgame {
  background: none;
  border: 1px solid #3a5147;
  color: #a9baaf;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: "Inter";
}
.newgame:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.col-labels,
.row {
  display: grid;
  gap: 8px;
}
.col-labels {
  margin-bottom: 10px;
}
.col-labels span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #7d9186;
  text-align: center;
  font-weight: 600;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile {
  position: relative;
  height: 75px;
  border-radius: 12px;
  perspective: 600px;
}
.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: 12px;
}
.tile.flipped .tile-inner {
  transform: rotateX(360deg);
}
.tile-front,
.tile-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  padding: 4px 6px;
  text-align: center;
}
.tile-front {
  background: var(--felt-2);
  border: 2px dashed #33473c;
}
.tile-back {
  transform: rotateX(360deg);
  color: #fff;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.15;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.tile-back.ok {
  background: linear-gradient(160deg, #37b85c, #279c4b);
}
.tile-back.mid {
  background: linear-gradient(160deg, #f0b429, #d99a06);
  color: #2b1e00;
}
.tile-back.bad {
  background: linear-gradient(160deg, #4d4d4d, #3a3a3a);
}

.tile-back.giveup {
  background: linear-gradient(160deg, #1f6b3a, #123d21);
  color: #d7e8da;
}

.card-name-tile .tile-front,
.card-name-tile .tile-back {
  flex-direction: row;
  gap: 8px;
  justify-content: flex-start;
  padding-left: 10px;
}
.mini-card {
  width: 22px;
  height: 32px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

.hint {
  font-size: 12px;
  color: #7d9186;
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
}
.legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #a9baaf;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.dot.ok {
  background: var(--ok);
}
.dot.mid {
  background: var(--mid);
}
.dot.bad {
  background: var(--bad);
}
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .wrap {
    max-width: 100%;
  }

  .logo {
    font-size: 32px;
  }

  .unodle-logo-img {
    height: 90px;
  }

  .col-labels span {
    font-size: 9px;
  }

  .tile {
    height: 56px;
  }

  .tile-back {
    font-size: 10px;
  }

  .mini-card {
    width: 18px;
    height: 26px;
    font-size: 8px;
  }

  .search-wrap input {
    font-size: 16px;
  }
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 12, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
}
.modal-box {
  position: relative;
  background: var(--felt-2);
  border: 1px solid #33473c;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #a9baaf;
  font-size: 18px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.modal-close:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
}
.modal-content h3 {
  font-family: "Baloo 2", sans-serif;
  color: var(--gold);
  margin-top: 0;
}
.modal-content p,
.modal-content li {
  font-family: "Inter";
  font-size: 14px;
  color: var(--paper);
  line-height: 1.6;
}
.modal-content ul {
  padding-left: 20px;
  margin: 8px 0;
}
.modal-content .changelog-version {
  font-family: "JetBrains Mono", monospace;
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(242, 183, 5, 0.2);
}
.modal-content .changelog-version:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.modal-content .modal-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(242, 183, 5, 0.08);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 13px;
  color: #c9d6cc;
}
.modal-confirm-btns {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: center;
}
.tile-back.truncated {
  cursor: pointer;
}
.tile-back .tile-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  width: 100%;
}
.tile-line {
  font-size: inherit;
  line-height: 1.05;
}
.tile-more {
  opacity: 0.7;
  font-size: 9.5px;
}
.tile-popover .popover-line {
  padding: 2px 0;
}
.tile-popover .popover-line + .popover-line {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 3px;
  padding-top: 5px;
}
.sugg-chip-values {
  display: flex;
  flex-direction: column;
  margin-top: 3px;
  gap: 1px;
}
.sugg-chip-more {
  opacity: 0.7;
}
.tile-popover {
  position: absolute;
  background: var(--felt-2);
  border: 1px solid #33473c;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--paper);
  white-space: normal;
  width: max-content;
  max-width: 220px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  z-index: 200;
  text-align: left;
  line-height: 1.4;
}
.hints-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.hint-chip {
  background: var(--felt-2);
  border: 1px solid rgba(242, 183, 5, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--paper);
}
.hint-chip-pop {
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hint-chip b {
  color: var(--gold);
}
@keyframes fadeOutScale {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}
.fading-out {
  animation: fadeOutScale 0.3s ease forwards;
  pointer-events: none;
}

@keyframes numberPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.3);
    color: var(--gold);
  }
  100% {
    transform: scale(1);
  }
}
.pulse {
  display: inline-block;
  animation: numberPulse 0.4s ease;
}
.banner.show.fading-out {
  animation: fadeOutScale 0.3s ease forwards;
}
