/* style.css */
body {
    background: #1a1a1a;
    color: #fff;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    padding: 20px 0;
    margin: 0;
    overflow-y: auto;
    min-height: 100vh;
}

h1 {
    font-size: clamp(2rem, 10vw, 4rem);
    font-weight: 900;
    color: #fff200;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 #e60012, -3px -3px 0 #e60012, 3px -3px 0 #e60012, -3px 3px 0 #e60012, 0 0 20px #ff0000, 0 0 40px #ffeb3b;
    animation: neon-flicker 0.15s infinite alternate;
    margin-bottom: 30px;
    letter-spacing: -2px;
    font-style: italic;
}

@keyframes neon-flicker {
    0% {
        opacity: 1;
        transform: scale(1) skewX(-5deg);
        filter: brightness(1.2);
    }

    100% {
        opacity: 0.9;
        transform: scale(1.02) skewX(-5deg);
        filter: brightness(1.5);
    }
}

.container {
    background: #2a2a2a;
    display: block;
    margin: 0 auto;
    padding: 20px;
    border-radius: 20px;
    border: 2px solid #444;
    width: 90%;
    max-width: 450px;
    box-sizing: border-box;
}

.label {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: bold;
    color: #ffeb3b;
    margin-bottom: 8px;
    text-align: left;
}

select,
input {
    font-size: clamp(1.5rem, 6vw, 2rem);
    width: 100%;
    background: #000;
    color: #0f0;
    border: 3px solid #0f0;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 15px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.main-btn {
    font-size: 1.5rem;
    padding: 15px;
    cursor: pointer;
    background: #e60012;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    width: 100%;
    transition: 0.2s;
}

.main-btn:hover {
    background: #ff3344;
    transform: scale(1.02);
}

/* 通常時は光らせない */
#result {
  display: block;
  font-size: clamp(6rem, 50vw, 15rem);
  font-weight: 900;
  font-style: italic;
  margin-top: 10px;
  line-height: 1;
  text-align: center;
  width: 100%;
  color: #555;
  text-shadow: none;
  filter: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 結果が出たときだけ光らせる */
#result.result-final {
  color: #fff200;
  text-shadow:
    0 0 10px #fff,
    0 0 20px #ffeb3b,
    0 0 40px #ff0000,
    0 0 70px #ff0000;
  filter: drop-shadow(0 0 15px rgba(255, 235, 59, 0.8));
}

/* エラー時の控えめなスタイル */
#result.error-mode {
    font-size: 2rem !important; /* 巨大化を強制解除 */
    color: #555 !important;
    text-shadow: none !important;
    filter: none !important;
    transform: scale(1) !important; /* 拡大をキャンセル */
    margin-top: 20px;
}

#progress-container {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #e60012, #ffeb3b);
}

#status-text {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: bold;
    color: #0f0;
    min-height: 1.6rem;
    margin-top: 15px;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.step-btn {
    width: 80px !important;
    height: 80px !important;
    font-size: 2.5rem !important;
    flex-shrink: 0;
}

#total {
    font-size: 2.5rem;
    height: 80px;
    max-width: 140px;
    margin-bottom: 0;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* メインレース選択時の特別スタイル */
select option[data-is-main="true"] {
    font-weight: bold !important;
    background: linear-gradient(45deg, #fff0f0, #ffeaea) !important;
    border-left: 4px solid #ff4757 !important;
}

/* キラキラエフェクト */
@keyframes sparkle {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-glow {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.result-glow.active {
  opacity: 1;
}

/* 通常レース（黄色） */
#result.result-normal {
  color: #fff200;
  text-shadow:
    0 0 10px #fff,
    0 0 20px #ffeb3b,
    0 0 40px #ff9900,
    0 0 70px #ff0000;
  filter: drop-shadow(0 0 15px rgba(255, 235, 59, 0.8));
}

/* グレードレース（赤） */
#result.result-grade {
  color: #ff1e1e;
  text-shadow:
    0 0 10px #fff,
    0 0 20px #ff0000,
    0 0 40px #ff0000,
    0 0 70px #b30000;
  filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.9));
}


#minus-btn, #plus-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#minus-btn,
#plus-btn {
  width: 64px;
  height: 64px;
  font-size: 1.8rem;
  font-weight: 800;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(145deg, #1a1a1a, #111);
  border: 2px solid #333;
  color: #fff;

  transition: transform 0.08s ease, box-shadow 0.1s ease;
}

#minus-btn:active,
#plus-btn:active {
  transform: scale(0.92);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

.note {
  margin: 8px auto 18px;
  padding: 10px 14px;
  max-width: 420px;

  font-size: 1rem;
  color: #ccc;
  line-height: 1.7;

  /* background: rgba(255,255,255,0.05);
  border-left: 4px solid #ffeb3b;
  border-radius: 8px; */

  text-align: center;
  color: #aaa;
  letter-spacing: 0.05em;
}