/* --- New Tools Styles --- */
.tool-stage {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 480px;
  grid-template-columns: none !important;
}

.tool-stage > * {
  margin-left: auto;
  margin-right: auto;
}

.tool-stage h2 {
  font-size: clamp(2.2rem, 5vw, 3.5rem) !important;
  font-weight: 900 !important;
  color: var(--ink) !important;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
  margin-top: 16px;
  margin-bottom: 24px;
}

.digital-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 160px;
  padding: 20px 40px;
  background: var(--panel-strong);
  border: 3px solid var(--accent);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 90, 79, 0.15);
  margin: 20px 0;
}

.digital-number {
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 900;
  color: var(--accent-dark);
  text-shadow: 0 0 20px rgba(255, 180, 84, 0.5);
  font-family: monospace, Inter, sans-serif;
}

.scrabble-tile {
  position: relative;
  width: 170px;
  height: 170px;
  background: linear-gradient(135deg, #f5e3c3, #e2c99b);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 35px rgba(0,0,0,0.5), inset 0 -4px 0 rgba(0,0,0,0.2);
  border: 4px solid #c4a672;
}

.scrabble-letter {
  font-size: clamp(4.5rem, 9vw, 6rem);
  font-weight: 900;
  color: #3d2b1f;
}

.scrabble-score {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #6b4d37;
}

.result-display-circle {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 4px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.5), inset 0 0 30px rgba(0,0,0,0.5);
  margin-top: 20px;
  transition: transform 0.2s;
}
.result-display-circle span {
  font-size: 5rem;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
}
.result-display-circle.animating {
  animation: popPulse 0.3s ease-in-out infinite alternate;
}
@keyframes popPulse {
  from { transform: scale(0.95); }
  to { transform: scale(1.05); }
}

/* Rock Paper Scissors */
.rps-container {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-strong);
  border-radius: 20px;
  border: 4px solid var(--blue);
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
.rps-icon {
  font-size: 6rem;
  animation: none;
}
.rps-animating .rps-icon {
  animation: rpsShake 0.4s infinite alternate ease-in-out;
}
@keyframes rpsShake {
  0% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(-25deg) scale(1.1); }
}

/* Playing Card */
.playing-card-container {
  perspective: 1000px;
  width: 200px;
  height: 280px;
  margin-top: 20px;
}
.playing-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card-back, .card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  backface-visibility: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.card-back {
  background: linear-gradient(135deg, #10141c 25%, transparent 25%) -25px 0,
              linear-gradient(225deg, #10141c 25%, transparent 25%) -25px 0,
              linear-gradient(315deg, #10141c 25%, transparent 25%),
              linear-gradient(45deg, #10141c 25%, transparent 25%);
  background-size: 50px 50px;
  background-color: var(--accent);
  border: 8px solid white;
}
.card-front {
  background: white;
  color: black;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  font-family: serif;
}
.card-front.red {
  color: #d72638;
}
.card-value-top {
  font-size: 2rem;
  font-weight: bold;
  align-self: flex-start;
  line-height: 1;
}
.card-suit-center {
  font-size: 5rem;
  align-self: center;
}
.card-value-bottom {
  font-size: 2rem;
  font-weight: bold;
  align-self: flex-end;
  line-height: 1;
  transform: rotate(180deg);
}
.playing-card.flipped {
  transform: rotateY(180deg);
}

/* Team Results Grid */
.team-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 10px;
}
.team-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.team-card-header {
  font-weight: 900;
  color: var(--accent-dark);
  margin-bottom: 12px;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.team-member {
  padding: 6px 0;
  font-size: 1rem;
  color: var(--ink);
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.team-member:last-child {
  border-bottom: none;
}

/* Roulette Simulator */
.roulette-wrap {
  position: relative;
  width: min(78vw, 320px);
  aspect-ratio: 1;
  margin-top: 16px;
}

.roulette-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid var(--accent-dark);
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.roulette-wheel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 10px solid #f5c76b;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #111722 0 22%, transparent 23%),
    conic-gradient(
      #0a8f5a 0deg 9.73deg,
      #c82432 9.73deg 19.46deg,
      #141820 19.46deg 29.19deg,
      #c82432 29.19deg 38.92deg,
      #141820 38.92deg 48.65deg,
      #c82432 48.65deg 58.38deg,
      #141820 58.38deg 68.11deg,
      #c82432 68.11deg 77.84deg,
      #141820 77.84deg 87.57deg,
      #c82432 87.57deg 97.3deg,
      #141820 97.3deg 107.03deg,
      #c82432 107.03deg 116.76deg,
      #141820 116.76deg 126.49deg,
      #c82432 126.49deg 136.22deg,
      #141820 136.22deg 145.95deg,
      #c82432 145.95deg 155.68deg,
      #141820 155.68deg 165.41deg,
      #c82432 165.41deg 175.14deg,
      #141820 175.14deg 184.87deg,
      #c82432 184.87deg 194.6deg,
      #141820 194.6deg 204.33deg,
      #c82432 204.33deg 214.06deg,
      #141820 214.06deg 223.79deg,
      #c82432 223.79deg 233.52deg,
      #141820 233.52deg 243.25deg,
      #c82432 243.25deg 252.98deg,
      #141820 252.98deg 262.71deg,
      #c82432 262.71deg 272.44deg,
      #141820 272.44deg 282.17deg,
      #c82432 282.17deg 291.9deg,
      #141820 291.9deg 301.63deg,
      #c82432 301.63deg 311.36deg,
      #141820 311.36deg 321.09deg,
      #c82432 321.09deg 330.82deg,
      #141820 330.82deg 340.55deg,
      #c82432 340.55deg 350.28deg,
      #141820 350.28deg 360deg
    );
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), inset 0 0 0 3px rgba(255, 255, 255, 0.18);
  transition: transform 4s cubic-bezier(0.08, 0.74, 0.09, 1);
}

.roulette-wheel::after {
  content: "";
  width: 72px;
  height: 72px;
  border: 6px solid #f5c76b;
  border-radius: 50%;
  background: var(--panel-strong);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}

.roulette-wheel span {
  position: absolute;
  top: 16px;
  left: 50%;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  transform-origin: 0 136px;
}

.roulette-wheel span:nth-child(1) { transform: rotate(0deg) translateX(-50%); color: #dfffea; }
.roulette-wheel span:nth-child(2) { transform: rotate(30deg) translateX(-50%); }
.roulette-wheel span:nth-child(3) { transform: rotate(60deg) translateX(-50%); }
.roulette-wheel span:nth-child(4) { transform: rotate(90deg) translateX(-50%); }
.roulette-wheel span:nth-child(5) { transform: rotate(120deg) translateX(-50%); }
.roulette-wheel span:nth-child(6) { transform: rotate(150deg) translateX(-50%); }
.roulette-wheel span:nth-child(7) { transform: rotate(180deg) translateX(-50%); }
.roulette-wheel span:nth-child(8) { transform: rotate(210deg) translateX(-50%); }
.roulette-wheel span:nth-child(9) { transform: rotate(240deg) translateX(-50%); }
.roulette-wheel span:nth-child(10) { transform: rotate(270deg) translateX(-50%); }
.roulette-wheel span:nth-child(11) { transform: rotate(300deg) translateX(-50%); }
.roulette-wheel span:nth-child(12) { transform: rotate(330deg) translateX(-50%); }

.roulette-result-red {
  color: #ff6b6b !important;
}

.roulette-result-black {
  color: #d9e2ef !important;
}

.roulette-result-green {
  color: #65d183 !important;
}

/* Slot Simulator */
.slot-machine {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 12px;
  width: min(100%, 420px);
  padding: 18px;
  border: 4px solid #f5c76b;
  border-radius: 18px;
  background: linear-gradient(180deg, #202636, #111722);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), inset 0 0 28px rgba(245, 199, 107, 0.12);
}

.slot-reel {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 2px solid rgba(245, 199, 107, 0.55);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7df, #f3e4b5);
  color: #20170f;
  font-size: clamp(1.45rem, 5vw, 2.35rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12);
  overflow-wrap: anywhere;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.slot-reel.spinning {
  filter: blur(1px);
  transform: translateY(-4px);
}

.slot-win .slot-reel {
  animation: slotWinPulse 0.42s ease-in-out 4 alternate;
}

@keyframes slotWinPulse {
  from { box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12), 0 0 0 rgba(255, 200, 87, 0); }
  to { box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12), 0 0 28px rgba(255, 200, 87, 0.72); }
}

.game-note {
  width: min(100%, 520px);
  margin: -10px auto 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .slot-machine {
    gap: 8px;
    padding: 12px;
  }

  .slot-reel {
    min-height: 92px;
    font-size: clamp(1.05rem, 8vw, 1.65rem);
  }

  .roulette-wheel span {
    transform-origin: 0 calc(min(78vw, 320px) / 2 - 24px);
  }
}
