@charset "UTF-8";

:root {
  --bg-main: #faeaee;
  --bg-top-glow: #fdf2f5;
  --card-white: #ffffff;
  --slot-card-bg: #fdeef2;
  --slot-card-border: #d57d98;
  --slot-window-bg: #230c19;
  --badge-gold: #c69135;
  --gold-border: #c59841;
  --crimson: #a11b47;
  --crimson-bright: #c81e56;
  --text-dark: #25111b;
  --text-muted: #6e5e64;
  --panel-border: #edd5dc;
  --btn-grad-start: #e52a69;
  --btn-grad-end: #b7194f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-top-glow) 0%, var(--bg-main) 100%);
  color: var(--text-dark);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-wrapper {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 18px 56px;
}

/* Header Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 14px;
}

.circle-icon-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(235, 210, 218, 0.7);
  box-shadow: 0 2px 8px rgba(161, 27, 71, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.circle-icon-btn:active {
  transform: scale(0.94);
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 17px;
  height: 9px;
}

.hamburger-lines span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #25111b;
  border-radius: 2px;
}

.dots-icon {
  display: flex;
  align-items: center;
  gap: 3.5px;
}

.dots-icon span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #25111b;
}

.avatar-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(161, 27, 71, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Title and Intro */
.app-title {
  text-align: center;
  color: var(--crimson);
  font-family: "Shippori Mincho B1", "M PLUS Rounded 1c", serif;
  font-size: 2.02rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 6px 0 14px;
  line-height: 1.3;
}

.app-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.75;
  margin-bottom: 20px;
}

/* Main Roulette White Panel */
.roulette-panel {
  background: var(--card-white);
  border: 1.5px solid var(--panel-border);
  border-radius: 22px;
  padding: 16px 15px 22px;
  box-shadow: 0 4px 18px rgba(161, 27, 71, 0.04);
}

/* Individual Slot Card */
.slot-card {
  background: var(--slot-card-bg);
  border: 1.5px solid var(--slot-card-border);
  border-radius: 16px;
  padding: 13px 14px 14px;
  margin-bottom: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.slot-card.is-spinning {
  box-shadow: 0 0 0 2px rgba(229, 42, 105, 0.28);
}

.slot-card.just-stopped {
  animation: slotPop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes slotPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.018); }
  100% { transform: scale(1); }
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.slot-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--badge-gold);
  color: #230c19;
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.slot-title {
  color: var(--text-dark);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.slot-Control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slot-count {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.reroll-btn {
  background: #ffffff;
  border: 1.4px solid #b83260;
  color: var(--crimson);
  border-radius: 999px;
  padding: 5px 13px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.reroll-btn:active {
  transform: scale(0.95);
  background: #fdeef2;
}

.reroll-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.slot-window {
  background: var(--slot-window-bg);
  border-radius: 12px;
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.slot-text {
  color: #ffffff;
  font-size: 1.22rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease, opacity 0.08s ease;
}

.slot-window.spinning .slot-text {
  animation: textRoll 0.11s infinite linear;
}

@keyframes textRoll {
  0% { transform: translateY(-6px); opacity: 0.75; }
  50% { transform: translateY(0px); opacity: 1; }
  100% { transform: translateY(6px); opacity: 0.75; }
}

/* Spin Footer inside White Panel */
.spin-footer {
  text-align: center;
  padding-top: 6px;
}

.spin-status {
  color: var(--crimson);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
  min-height: 1.5em;
}

.main-spin-btn {
  width: 100%;
  max-width: 340px;
  height: 60px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--btn-grad-start) 0%, var(--btn-grad-end) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(183, 25, 79, 0.25);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.main-spin-btn:active {
  transform: scale(0.97);
}

.main-spin-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Determined Situation Card */
.situation-card {
  margin-top: 22px;
  background: var(--card-white);
  border: 1.5px solid var(--gold-border);
  border-radius: 20px;
  padding: 22px 20px 22px;
  box-shadow: 0 4px 16px rgba(197, 152, 65, 0.07);
}

.situation-caption {
  color: var(--badge-gold);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.situation-text {
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.56;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  word-break: break-word;
}

.situation-text .accent-phrase {
  color: var(--crimson);
}

.situation-text .normal-phrase {
  color: var(--text-dark);
}

.situation-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sub-action-btn {
  background: #ffffff;
  border: 1.5px solid #e3cdd4;
  color: var(--text-dark);
  border-radius: 999px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.1s ease;
}

.sub-action-btn:active {
  transform: scale(0.96);
  background: #fdf2f5;
}

/* History Section */
.history-section {
  margin-top: 28px;
}

.history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px;
}

.history-title {
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--text-dark);
}

.clear-history-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--card-white);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 17px;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.62;
  color: var(--text-dark);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.history-item:active {
  transform: scale(0.99);
  border-color: var(--slot-card-border);
}

.history-num {
  color: var(--crimson-bright);
  font-weight: 800;
  margin-right: 4px;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 24px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  border: 1px dashed var(--panel-border);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 12, 25, 0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 84vh;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 18px 18px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -6px 24px rgba(35, 12, 25, 0.16);
}

.modal-sheet-compact {
  max-height: 60vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.05rem;
  color: var(--crimson);
  font-weight: 800;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-main);
  color: var(--text-dark);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tab-btn {
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--bg-top-glow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--crimson);
  color: #ffffff;
  border-color: var(--crimson);
}

.add-item-row {
  display: flex;
  gap: 6px;
}

.item-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--panel-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
}

.particle-select {
  padding: 8px;
  border: 1.5px solid var(--panel-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
}

.add-item-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: var(--crimson);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.word-list-container {
  max-height: 42vh;
  overflow-y: auto;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.word-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-top-glow);
  border-radius: 8px;
  font-size: 0.88rem;
}

.word-delete-btn {
  border: none;
  background: none;
  color: #b83260;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.reset-words-btn {
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.92rem;
  font-weight: 700;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-btns {
  display: flex;
  gap: 6px;
}

.preset-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--slot-card-border);
  background: var(--slot-card-bg);
  color: var(--crimson);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.action-sheet-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--panel-border);
  background: var(--bg-top-glow);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #dcc5cd;
  transition: 0.2s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--crimson);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(35, 12, 25, 0.92);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
