.tr-label {
  margin: 0 0 10px;
  font-family: "Jua", sans-serif;
  font-size: 18px;
  text-align: center;
  color: var(--ad-ink);
}

.tr-friend {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(170deg, #fff8e4, #ffeccf);
  border: 1.5px dashed var(--ad-gold-deep);
  color: var(--ad-ink);
  text-align: center;
  line-height: 1.55;
  box-shadow: var(--ad-shadow);
}

.tr-items {
  list-style: none;
  margin: 14px 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tr-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #f7f0e3;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ad-sub);
}

.tr-items b {
  display: block;
  color: var(--ad-ink);
  font-size: 13.5px;
}

.tr-items i {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-style: normal;
  font-size: 18px;
}

.tr-items .gold {
  background: linear-gradient(135deg, #ffe08a, #ff9ec4, #9fd8ff);
}

.tr-items .ice {
  background: #cfeaff;
}

.tr-items .sweep {
  background: #e3d6ff;
}

.tr-items .heal {
  background: #cdf3dc;
}

.tr-tip {
  margin: -4px 0 0;
  color: var(--ad-on-sub);
  font-size: 13px;
  text-align: center;
}

/* ---------- 게임 중 (화면 전체) ---------- */
.tr-play {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  height: var(--vvh, 100dvh);
  transform: translateY(var(--vvtop, 0px));
  background: linear-gradient(180deg, #1a1440, #2b1f5c 55%, #3b2a6e);
}

.tr-play.hidden {
  display: none;
}

.tr-hud {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
}

.tr-chip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ad-on-sub);
  font-size: 11px;
  font-weight: 700;
}

.tr-chip b {
  color: #fff6d6;
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tr-pause {
  flex: 0 0 auto;
  appearance: none;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ad-ink);
  font-size: 18px;
  cursor: pointer;
}

.tr-field {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.tr-field canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.tr-banner {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.95);
  color: var(--ad-ink);
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 26px;
  white-space: nowrap;
  box-shadow: 0 0 0 4px var(--ad-gold), 0 16px 36px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: tr-pop 1.4s ease forwards;
}

@keyframes tr-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  15%,
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1);
  }
}

.tr-paused {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(15, 10, 35, 0.72);
  backdrop-filter: blur(4px);
}

.tr-paused p {
  margin: 0 0 6px;
  color: #fff6d6;
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 34px;
}

.tr-paused .ad-btn {
  width: min(240px, 70vw);
}

.tr-input {
  display: flex;
  gap: 8px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background: rgba(10, 8, 25, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.tr-input input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 2px solid rgba(255, 201, 74, 0.6);
  border-radius: 16px;
  background: #fffaf2;
  color: var(--ad-ink);
  font: inherit;
  font-family: "Jua", sans-serif;
  font-size: 22px;
}

.tr-input input:focus {
  outline: none;
  border-color: var(--ad-gold);
  box-shadow: 0 0 0 4px rgba(255, 201, 74, 0.25);
}

.tr-input input.miss {
  animation: tr-shake 0.3s;
  border-color: #ff5c7a;
}

@keyframes tr-shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.tr-enter {
  flex: 0 0 auto;
  appearance: none;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--ad-accent-2), var(--ad-accent));
  color: #fff;
  font: inherit;
  font-family: "Jua", sans-serif;
  font-size: 18px;
  cursor: pointer;
}

/* ---------- 결과 ---------- */
.tr-done-emoji {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff, #dfe3ff);
  box-shadow: 0 0 0 5px #ffd766, 0 0 0 10px rgba(255, 215, 102, 0.3), 0 14px 30px rgba(40, 40, 120, 0.25);
  font-size: 60px;
  line-height: 1;
}

.tr-done h2 {
  margin: 12px 0 2px;
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-weight: 400;
  font-size: 36px;
}

.tr-done-score {
  margin: 0 0 12px;
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 34px;
  color: var(--ad-accent-deep);
}

.tr-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.tr-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.tr-stats b {
  font-family: "Bagel Fat One", "Jua", sans-serif;
  font-size: 24px;
  font-weight: 400;
}

.tr-stats span {
  color: var(--ad-sub);
  font-size: 12px;
  font-weight: 700;
}
