﻿:root {
  --bg: #070d1f;
  --panel: #111a35;
  --line: #30467f;
  --text: #eef3ff;
  --dim: #9bb0da;
  --pink: #ff4fb8;
  --blue: #52d9ff;
  --yellow: #ffe96a;
  --ok: #8dffb3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 12px;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(1000px 450px at 10% -20%, #1b2c68 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #341853 0%, transparent 58%),
    linear-gradient(160deg, #050814 0%, #080f24 55%, #050912 100%);
}

.app {
  max-width: 760px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(18, 31, 66, 0.92), rgba(11, 18, 38, 0.95));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.title-area {
  text-align: center;
  margin-bottom: 10px;
}

.title-area h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.8vw, 2.2rem);
  letter-spacing: 0.8px;
  text-shadow: 0 0 14px rgba(82, 217, 255, 0.35);
}

.title-bonus {
  text-shadow: 0 0 16px rgba(255, 233, 106, 0.8), 0 0 28px rgba(255, 79, 184, 0.4);
}

.lamp-area {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.lamp {
  min-width: 120px;
  text-align: center;
  padding: 8px 20px;
  border-radius: 999px;
  border: 2px solid #627db7;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.16s ease;
}

.lamp-off {
  background: rgba(110, 138, 198, 0.08);
  color: #7e94c4;
}

.lamp-hit {
  background: linear-gradient(180deg, #f7ffa7, #dcff8e);
  color: #22290c;
  border-color: #f5ffae;
  box-shadow: 0 0 14px rgba(245, 255, 122, 0.75);
}

.lamp-bonus {
  background: linear-gradient(180deg, #fff4a8, #ffc96f);
  color: #271704;
  border-color: #ffe58e;
  box-shadow: 0 0 16px rgba(255, 233, 106, 0.9), 0 0 30px rgba(82, 217, 255, 0.45);
}

.lamp-blink {
  animation: blink 0.18s linear 4;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.machine-area {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(10, 19, 42, 0.92);
  margin-bottom: 10px;
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.reel {
  border: 2px solid #647db4;
  border-radius: 10px;
  padding: 7px;
  background: #f3f6ff;
}

.reel-strip {
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #879bcf;
  background: #ffffff;
}

.cell {
  height: 52px;
  font-size: 1.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #d0daf4;
}

.cell:last-child {
  border-bottom: none;
}

.center {
  background: #eaf0ff;
  box-shadow: inset 0 0 0 2px #aec2f4;
}

.stop-btn {
  width: 100%;
  margin-top: 7px;
  border: none;
  border-radius: 9px;
  min-height: 42px;
  background: #3c4f83;
  color: #d9e5ff;
  font-weight: 700;
  opacity: 0.52;
  cursor: not-allowed;
  transition: transform 0.1s ease, box-shadow 0.18s ease;
}

.stop-btn.enabled {
  opacity: 1;
  cursor: pointer;
  background: linear-gradient(180deg, #62b0ff, #3f72ff);
  box-shadow: 0 0 13px rgba(82, 217, 255, 0.62);
}

.stop-btn.enabled:active,
.main-btn:active,
.sub-btn:active {
  transform: scale(0.98);
}

.main-controls,
.sub-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.main-controls {
  grid-template-columns: repeat(2, 1fr);
}

.sub-controls {
  grid-template-columns: repeat(3, 1fr);
}

.main-btn,
.sub-btn {
  border: none;
  border-radius: 10px;
  min-height: 46px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.main-btn {
  background: linear-gradient(180deg, #ff61c3, #d72887);
}

.main-btn.spin {
  background: linear-gradient(180deg, #58dfff, #2f7fff);
}

.sub-btn {
  background: linear-gradient(180deg, #425d9a, #2f467d);
}

.sub-btn.danger {
  background: linear-gradient(180deg, #ff7f7f, #cf3f3f);
}

.main-btn:disabled,
.sub-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.status-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 20, 45, 0.86);
  text-align: center;
  padding: 8px;
}

.status-box span {
  display: block;
  color: var(--dim);
  font-size: 0.78rem;
}

.status-box strong {
  font-size: 1.35rem;
}

.message-area {
  border-radius: 10px;
  border: 1px solid #465f9f;
  background: linear-gradient(180deg, #081129, #030715);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.6px;
  color: var(--ok);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
  margin-bottom: 10px;
}

.message-bonus {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 233, 106, 0.75);
}

.message-miss {
  color: #ffc4c4;
}

.info-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 18, 39, 0.85);
  padding: 10px;
  margin-bottom: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}

.stat-item {
  border: 1px solid #334f88;
  border-radius: 8px;
  text-align: center;
  padding: 7px;
}

.stat-item span {
  display: block;
  font-size: 0.76rem;
  color: var(--dim);
}

.history-wrap h2 {
  margin: 0 0 6px;
  color: var(--dim);
  font-size: 0.95rem;
}

#historyList {
  margin: 0;
  padding-left: 16px;
}

#historyList li {
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.history-bonus {
  color: var(--yellow);
  font-weight: 700;
}

.history-hit {
  color: #9effcf;
}

.history-miss {
  color: #c8d1e8;
}

.history-empty {
  color: var(--dim);
}

.footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: #97add6;
  border-top: 1px solid rgba(84, 108, 166, 0.5);
  padding-top: 8px;
}

.machine-shake {
  animation: shake 0.24s linear 2;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

@media (max-width: 500px) {
  body {
    padding: 8px;
  }

  .app {
    padding: 10px;
  }

  .cell {
    height: 44px;
    font-size: 1.55rem;
  }

  .main-btn,
  .sub-btn,
  .stop-btn {
    min-height: 42px;
    font-size: 0.9rem;
  }

  #historyList li {
    font-size: 0.82rem;
  }
}
