* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
  background: #000;
  color: #fff;
  overflow-x: hidden;
}

/* ---- particle background ---- */
.particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---- gradient mesh blobs ---- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-mesh .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}
.bg-mesh .blob-1 {
  width: 700px; height: 700px;
  top: -10%; left: -5%;
  background: #7c3aed;
  animation: drift-a 18s ease-in-out infinite alternate;
}
.bg-mesh .blob-2 {
  width: 600px; height: 600px;
  bottom: -10%; right: -5%;
  background: #db2777;
  animation: drift-b 20s ease-in-out infinite alternate;
}
.bg-mesh .blob-3 {
  width: 500px; height: 500px;
  top: 40%; left: 45%;
  background: #0ea5e9;
  animation: drift-c 16s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(80px, 60px); } }
@keyframes drift-b { to { transform: translate(-60px, -80px); } }
@keyframes drift-c { to { transform: translate(-40px, 50px); } }

/* ---- grid overlay ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ---- main app ---- */
.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

/* ---- header ---- */
.header {
  text-align: center;
  margin-bottom: 36px;
}

.header-box {
  display: inline-block;
  padding: 28px 48px;
  background: rgba(0,0,0,.75);
  border: 3px solid #c026d3;
  border-radius: 20px;
  box-shadow:
    0 0 30px rgba(192,38,211,.6),
    0 0 80px rgba(6,182,212,.25),
    inset 0 0 40px rgba(6,182,212,.15);
}

.header-icons {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 2.2rem;
}
.header-icons .icon:nth-child(1) { color: #facc15; }
.header-icons .icon:nth-child(2) { color: #f472b6; }
.header-icons .icon:nth-child(3) { color: #22d3ee; }

.title-main {
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  font-weight: 900;
  background: linear-gradient(90deg, #f472b6, #a855f7, #22d3ee);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: grad-x 4s ease infinite;
  line-height: 1.15;
}

.title-sub {
  margin-top: 8px;
  font-size: clamp(1.1rem, 2.8vw, 1.7rem);
  font-weight: 900;
  background: linear-gradient(90deg, #facc15, #f97316, #ef4444);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: grad-x 4s ease infinite;
}

.tagline {
  margin-top: 18px;
  font-size: clamp(.9rem, 1.8vw, 1.25rem);
  font-weight: 700;
  background: linear-gradient(90deg, #22d3ee, #a855f7, #f472b6);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: grad-x 4s ease infinite;
}

/* ---- wheels grid ---- */
.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 700px) {
  .board { grid-template-columns: 1fr; }
}

.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* wheel titles */
.wheel-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 900;
  padding: 12px 28px;
  margin-bottom: 20px;
  border-radius: 14px;
  border: 2px solid rgba(59,130,246,.55);
  background: rgba(0,0,0,.5);
  color: #60a5fa;
  text-shadow: 0 0 12px rgba(59,130,246,.7);
  box-shadow: 0 0 20px rgba(59,130,246,.35);
}

.wheel-title-orange {
  border-color: rgba(251,191,36,.55);
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251,191,36,.7);
  box-shadow: 0 0 20px rgba(251,191,36,.35);
}

/* wheel container */
.wheel-container {
  position: relative;
  display: flex;
  justify-content: center;
}

.wheel-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: pulse-glow 3s ease-in-out infinite;
}
.wheel-glow-blue  { background: radial-gradient(circle, rgba(59,130,246,.45), transparent 70%); }
.wheel-glow-orange { background: radial-gradient(circle, rgba(251,191,36,.45), transparent 70%); }

.wheel-wrap {
  position: relative;
  z-index: 1;
}

/* pointer */
.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid #3b82f6;
  z-index: 10;
  filter: drop-shadow(0 0 8px rgba(59,130,246,.9));
}
.pointer-orange {
  border-top-color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251,191,36,.9));
}

/* canvas wheels */
.wheel-canvas {
  display: block;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px #1a1d3a,
    0 0 0 10px #3b82f6,
    0 0 35px rgba(59,130,246,.7);
}
.wheel-canvas-orange {
  box-shadow:
    0 0 0 6px #1a1d3a,
    0 0 0 10px #f59e0b,
    0 0 35px rgba(245,158,11,.7);
}

/* ---- result ---- */
.result {
  max-width: 750px;
  margin: 0 auto 28px;
}

.result-box {
  padding: 36px;
  background: rgba(0,0,0,.85);
  border: 3px solid #c026d3;
  border-radius: 20px;
  box-shadow:
    0 0 40px rgba(192,38,211,.5),
    0 0 80px rgba(6,182,212,.2),
    inset 0 0 50px rgba(6,182,212,.12);
}

.result-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 28px;
  background: linear-gradient(90deg, #facc15, #f472b6, #22d3ee);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: grad-x 3s ease infinite;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 500px) {
  .result-grid { grid-template-columns: 1fr; }
}

.result-item {
  padding: 28px 16px;
  border-radius: 14px;
  border: 3px solid rgba(255,255,255,.25);
  text-align: center;
}

.result-item-label {
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin-bottom: 12px;
}

.result-item-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.result-item-value {
  font-size: 2.2rem;
  font-weight: 900;
}

.result-ready {
  text-align: center;
  margin-top: 28px;
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, #10b981, #22d3ee);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: grad-x 3s ease infinite;
}

/* ---- controls ---- */
.controls {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn {
  padding: 18px 36px;
  font-size: 1.15rem;
  font-weight: 900;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .2s, box-shadow .2s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(90deg, #c026d3, #7c3aed, #0ea5e9);
  box-shadow: 0 0 40px rgba(124,58,237,.7);
}
.btn-primary:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 0 60px rgba(124,58,237,.9);
}

.btn-muted {
  background: #1e293b;
  border: 2px solid #475569;
}
.btn-muted:hover { background: #334155; }

.btn-icon { font-size: 1.3rem; }

/* ---- history ---- */
.history {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px;
  background: rgba(0,0,0,.8);
  border: 3px solid #a855f7;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(168,85,247,.45);
  max-height: 550px;
  display: flex;
  flex-direction: column;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 18px;
}
.history-title span:first-child { font-size: 1.8rem; }

.history-count {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
}

#history-list::-webkit-scrollbar { width: 8px; }
#history-list::-webkit-scrollbar-track { background: rgba(15,23,42,.5); border-radius: 8px; }
#history-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a855f7, #ec4899);
  border-radius: 8px;
}

#history-list li {
  padding: 14px;
  background: rgba(13,21,48,.9);
  border: 2px solid rgba(168,85,247,.3);
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.history-icon { font-size: 1.8rem; }

.history-info { display: flex; flex-direction: column; gap: 2px; }
.history-pair { font-weight: 900; font-size: 1.05rem; }
.history-meta { font-size: .78rem; color: #94a3b8; }

.history-lot {
  padding: 6px 14px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  text-align: center;
}
.history-lot-label { font-size: .65rem; font-weight: 700; color: rgba(255,255,255,.8); }
.history-lot-value { font-size: 1.4rem; font-weight: 900; }

.history-empty {
  text-align: center;
  padding: 40px 20px;
}
.history-empty.hidden { display: none; }

.empty-icon {
  font-size: 4.5rem;
  margin-bottom: 20px;
  animation: bounce 2s ease-in-out infinite;
}
.empty-title {
  font-size: 1.7rem;
  font-weight: 900;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.empty-subtitle { font-size: 1rem; font-weight: 600; color: #94a3b8; }

/* ---- keyframes ---- */
@keyframes grad-x {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: .45; }
  50% { opacity: .7; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@media (max-width: 700px) {
  .header-box { padding: 20px 28px; }
  .controls { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

/* ===== EURJPY easter egg ===== */
.ej-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.85);
  animation: ej-flash .15s ease infinite alternate;
  transition: opacity .6s ease;
}
.ej-overlay.ej-fade-out { opacity: 0; }

.ej-text {
  font-size: clamp(4rem, 14vw, 10rem);
  font-weight: 900;
  color: #ff0000;
  text-shadow:
    0 0 20px #ff0000,
    0 0 60px #ff0000,
    0 0 120px #ff4444,
    4px 4px 0 #000;
  animation: ej-scale .3s ease infinite alternate;
  letter-spacing: 6px;
  text-align: center;
}

.ej-sub {
  font-size: 3rem;
  margin-top: 16px;
  animation: ej-spin 0.5s linear infinite;
}

@keyframes ej-flash {
  0%   { background: rgba(255,0,0,.25); }
  100% { background: rgba(168,0,255,.25); }
}

@keyframes ej-scale {
  0%   { transform: scale(1) rotate(-2deg); }
  100% { transform: scale(1.15) rotate(2deg); }
}

@keyframes ej-spin {
  to { transform: rotate(360deg); }
}

.ej-shake {
  animation: ej-shake-frames .08s linear infinite;
}

@keyframes ej-shake-frames {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-6px, 4px); }
  50%  { transform: translate(6px, -4px); }
  75%  { transform: translate(-4px, -6px); }
  100% { transform: translate(4px, 6px); }
}

/* ===== FULL PORT THURSDAY ===== */
.fpt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fpt-bg .2s ease infinite alternate;
  transition: opacity .6s ease;
}
.fpt-overlay.fpt-fade-out { opacity: 0; }

.fpt-banner {
  font-size: clamp(3rem, 12vw, 8rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(90deg, #facc15, #f97316, #ef4444, #facc15);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fpt-text .3s ease infinite alternate, grad-x .6s linear infinite;
  filter: drop-shadow(0 0 30px rgba(250,204,21,.8)) drop-shadow(0 0 60px rgba(249,115,22,.6));
}

.fpt-sub {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  color: #fff;
  margin-top: 12px;
  text-shadow: 0 0 20px #facc15, 0 0 50px #f97316;
  animation: fpt-text .25s ease infinite alternate-reverse;
}

.fpt-rockets {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-top: 20px;
  animation: fpt-spin .6s linear infinite;
}

@keyframes fpt-bg {
  0%   { background: rgba(250,204,21,.3); }
  100% { background: rgba(249,115,22,.3); }
}

@keyframes fpt-text {
  0%   { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.12) rotate(3deg); }
}

@keyframes fpt-spin {
  to { transform: rotate(360deg); }
}
