/* Test Your Luck CSS Variables & Game Specific Styles */
:root {
  --test-accent: #be185d;
  --test-accent-rgb: 190, 24, 93;
}

.t-intro-icon::before {
  content: 'casino';
}

/* ════ INTRO PREVIEW ANIMATION ════ */
/* Compliant with: loop speeds (4.5s-6.0s), cursor bounding box (20x20px), fingertip center alignment */

.tyl-preview-arena {
  position: relative;
  width: 280px;
  height: 140px;
  background: color-mix(in srgb, var(--test-accent) 3%, rgba(0, 0, 0, 0.45));
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

html.light .tyl-preview-arena {
  background: color-mix(in srgb, var(--test-accent) 5%, rgba(0, 0, 0, 0.04));
}

.tyl-preview-header {
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.tyl-preview-choices {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.tyl-p-btn {
  font-family: var(--font-b);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-outline);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tyl-p-btn.active {
  border-color: var(--test-accent);
  background: rgba(var(--test-accent-rgb), 0.12);
  color: var(--text);
  box-shadow: 0 0 10px rgba(var(--test-accent-rgb), 0.15);
  animation: tylPBtnSelect 5.0s infinite steps(1);
}

@keyframes tylPBtnSelect {
  0%, 29% { border-color: var(--color-outline); background: rgba(255, 255, 255, 0.02); color: var(--text-muted); box-shadow: none; }
  30%, 100% { border-color: var(--test-accent); background: rgba(var(--test-accent-rgb), 0.12); color: var(--text); box-shadow: 0 0 10px rgba(var(--test-accent-rgb), 0.15); }
}

.tyl-p-triangle {
  font-size: 11px;
  vertical-align: middle;
  display: inline-block;
  margin-right: 2px;
}
.tyl-p-triangle.down {
  color: #ef4444;
}
.tyl-p-triangle.up {
  color: #10b981;
}

.tyl-preview-dice-row {
  display: flex;
  gap: 12px;
}

.tyl-p-die {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #ffffff;
  color: #be185d;
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.tyl-p-die::after {
  content: '?';
  animation: tylPDieOutcome 5.0s infinite steps(1);
}

@keyframes tylPDieOutcome {
  0%, 41% { content: '?'; }
  42%, 100% { content: attr(class); }
}
/* override content binding dynamically */
.tyl-p-die.side-5::after { content: '?'; }
.tyl-p-die.side-4::after { content: '?'; }
@keyframes tylPDieVal5 {
  0%, 41% { content: '?'; }
  42%, 100% { content: '5'; }
}
@keyframes tylPDieVal4 {
  0%, 41% { content: '?'; }
  42%, 100% { content: '4'; }
}
.tyl-preview-dice-row .tyl-p-die:first-child::after { animation: tylPDieVal5 5.0s infinite steps(1); }
.tyl-preview-dice-row .tyl-p-die:last-child::after { animation: tylPDieVal4 5.0s infinite steps(1); }

.tyl-preview-click {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  z-index: 10;
  animation: tylClickAnimate 5.0s infinite linear;
}

.tyl-preview-click span {
  font-size: 20px;
  line-height: 1;
  display: block;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Finger click centering and smooth hover/press keyframe loop (5.0s cycle) */
@keyframes tylClickAnimate {
  0% { left: 200px; top: 120px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  10% { left: 200px; top: 120px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  22% { left: 175px; top: 92px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  26% { left: 175px; top: 92px; opacity: 1; transform: translate(-35%, -15%) scale(0.8); }
  29% { left: 175px; top: 92px; opacity: 1; transform: translate(-35%, -15%) scale(1.1); }
  35% { left: 175px; top: 92px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  45% { left: 200px; top: 120px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  100% { left: 200px; top: 120px; opacity: 0; }
}

.tyl-preview-caption {
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
  line-height: 1.4;
  margin-top: 10px;
}

.tyl-preview-caption .tyl-highlight {
  color: var(--test-accent);
  font-weight: 700;
}


/* ════ GAMEPLAY BOARD & ARENA ════ */

.tyl-game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100% !important;
  min-height: 480px;
  border-radius: 12px;
  border: 1px solid var(--color-outline);
  background: rgba(255, 255, 255, 0.01);
  padding: 32px 24px !important;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-top: 0 !important;
  margin-bottom: 24px !important;
}

/* Feedback States */
.tyl-game-container.roll-success {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.01) 100%) !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(16, 185, 129, 0.05);
}

.tyl-game-container.roll-failed {
  border-color: #ef4444 !important;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.01) 100%) !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.12), inset 0 1px 0 rgba(239, 68, 68, 0.05);
}

.tyl-game-container.roll-tie {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.01) 100%) !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(245, 158, 11, 0.05);
}

/* Central Target Arena Header */
.tyl-target-arena-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 8px;
}

.tyl-wing {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.65;
  width: 70px;
}

.tyl-wing.under {
  color: #ef4444;
  text-align: right;
}

.tyl-wing.over {
  color: #10b981;
  text-align: left;
}

.wing-symbol {
  font-size: 20px;
  margin-top: 4px;
}

.tyl-target-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--test-accent-rgb), 0.15) 0%, rgba(var(--test-accent-rgb), 0.02) 100%);
  border: 2px solid var(--test-accent);
  box-shadow: 0 0 20px rgba(var(--test-accent-rgb), 0.25), inset 0 0 12px rgba(var(--test-accent-rgb), 0.15);
}

.target-num {
  font-family: var(--font-h);
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

/* Feedback HUD Styles */
.tyl-feedback-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 54px;
}

.tyl-status {
  font-family: var(--font-h);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.roll-success .tyl-status {
  color: #10b981 !important;
}

.roll-failed .tyl-status {
  color: #ef4444 !important;
}

.roll-tie .tyl-status {
  color: #f59e0b !important;
}

.tyl-sub {
  font-family: var(--font-b);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Split Controller Panel styling */
.tyl-controller-panel {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}

.tyl-controller-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tyl-choice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 12px;
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  outline: none;
  background: rgba(255, 255, 255, 0.01);
  border: 1.5px solid var(--color-outline);
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-symbol {
  font-size: 16px;
  line-height: 1;
}

/* Hover States when not active/selected */
.btn-under:hover:not(:disabled) {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  transform: translateY(-2px);
}

.btn-over:hover:not(:disabled) {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
  color: #10b981;
  transform: translateY(-2px);
}

/* Selection / Fill States */
.btn-under.selected {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
  transform: translateY(-2px);
}

.btn-over.selected {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.tyl-choice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* Range Hint Styling */
.range-hint {
  font-family: var(--font-b);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.text-under {
  color: rgba(239, 68, 68, 0.85);
}

.text-over {
  color: rgba(16, 185, 129, 0.85);
}


/* ─── 3D DICE ENGINE STYLES (adapted from codepen) ─── */

.tyl-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  height: 150px;
  width: 100%;
  perspective: 1000px;
  position: relative;
}

.dice-wrapper {
  width: 90px;
  height: 90px;
}

.dice {
  position: relative;
  width: 90px;
  height: 90px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.15, 0.85, 0.35, 1);
  transform: rotateX(0deg) rotateY(0deg);
}

.side {
  position: absolute;
  background-color: #ffffff;
  border-radius: 10px;
  width: 90px;
  height: 90px;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.1), 0 3px 6px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

/* Dots inside dice faces */
.dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #be185d;
  transform: translate(-50%, -50%);
}

/* 3D Dice Sides placement */
.side.one   { transform: translateZ(45px); }
.side.six   { transform: rotateY(90deg) translateZ(45px); }
.side.three { transform: rotateY(-90deg) translateZ(45px); }
.side.four  { transform: rotateX(90deg) translateZ(45px); }
.side.five  { transform: rotateX(-90deg) translateZ(45px); }
.side.two   { transform: rotateY(180deg) translateZ(45px); }

/* Rotations to show each face dynamically */
.dice.show-1 { transform: rotateX(720deg) rotateY(720deg); }
.dice.show-2 { transform: rotateX(720deg) rotateY(540deg); }
.dice.show-3 { transform: rotateX(720deg) rotateY(810deg); }
.dice.show-4 { transform: rotateX(630deg) rotateY(720deg); }
.dice.show-5 { transform: rotateX(810deg) rotateY(720deg); }
.dice.show-6 { transform: rotateX(720deg) rotateY(630deg); }

/* Dot placement coordinates */
.one-1   { top: 50%; left: 50%; }
.two-1   { top: 25%; left: 25%; }
.two-2   { top: 75%; left: 75%; }
.three-1 { top: 20%; left: 20%; }
.three-2 { top: 50%; left: 50%; }
.three-3 { top: 80%; left: 80%; }
.four-1  { top: 25%; left: 25%; }
.four-2  { top: 25%; left: 75%; }
.four-3  { top: 75%; left: 25%; }
.four-4  { top: 75%; left: 75%; }
.five-1  { top: 20%; left: 20%; }
.five-2  { top: 20%; left: 80%; }
.five-3  { top: 50%; left: 50%; }
.five-4  { top: 80%; left: 20%; }
.five-5  { top: 80%; left: 80%; }
.six-1   { top: 20%; left: 20%; }
.six-2   { top: 20%; left: 80%; }
.six-3   { top: 50%; left: 20%; }
.six-4   { top: 50%; left: 80%; }
.six-5   { top: 80%; left: 20%; }
.six-6   { top: 80%; left: 80%; }


/* HUD & BUTTONS */

.tyl-hud-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-height: 52px;
}

.tyl-status {
  font-family: var(--font-h);
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

.tyl-sub {
  font-family: var(--font-b);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.tyl-roll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  padding: 14px 32px;
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--test-accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--test-accent-rgb), 0.3);
  transition: all 0.2s ease;
  outline: none;
}

.tyl-roll-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--test-accent) 85%, #fff);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(var(--test-accent-rgb), 0.4);
}

.tyl-roll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 480px) {
  .tyl-game-container { min-height: 320px; }
  .tyl-status { font-size: 20px; }
  .tyl-sub { font-size: 12.5px; }
  .tyl-choices-container { gap: 10px; max-width: 300px; margin: 10px 0; }
  .tyl-choice-btn { padding: 10px 8px; border-radius: 10px; }
  .tyl-triangle-svg { width: 26px; height: 26px; }
  .tyl-choice-lbl { font-size: 13px; }
  .tyl-choice-range { font-size: 10px; }
  .tyl-target-display { font-size: 18px; }
  .tyl-target-display span { font-size: 26px; }
  .tyl-roll-btn { max-width: 300px; padding: 12px; font-size: 15px; border-radius: 10px; }
  .tyl-arena { gap: 20px; height: 120px; }
  .dice-wrapper { width: 70px; height: 70px; }
  .dice { width: 70px; height: 70px; }
  .side { width: 70px; height: 70px; border-radius: 8px; }
  .side.one   { transform: translateZ(35px); }
  .side.six   { transform: rotateY(90deg) translateZ(35px); }
  .side.three { transform: rotateY(-90deg) translateZ(35px); }
  .side.four  { transform: rotateX(90deg) translateZ(35px); }
  .side.five  { transform: rotateX(-90deg) translateZ(35px); }
  .side.two   { transform: rotateY(180deg) translateZ(35px); }
  .dot { width: 10px; height: 10px; }
}

/* Trial predictions list style (dynamic height, no overlapping) */
.tyl-trial-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

/* Light Theme Overrides */
.light .tyl-target-circle {
  background: radial-gradient(circle, rgba(var(--test-accent-rgb), 0.1) 0%, rgba(var(--test-accent-rgb), 0.02) 100%);
  border-color: var(--test-accent);
  box-shadow: 0 2px 10px rgba(var(--test-accent-rgb), 0.1);
}

.light .target-num {
  color: var(--test-accent);
}

.light .tyl-status {
  color: #1e293b;
}

.light .tyl-choice-btn {
  background: #ffffff;
  border-color: #cbd5e1;
}

.light .tyl-p-btn {
  background: #ffffff;
  border-color: #cbd5e1;
}

.light .tyl-preview-header {
  color: #be185d;
}

.light .tyl-preview-click span {
  color: #1e293b;
  text-shadow: none;
}

