* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0,255,200,0.10), transparent 28%),
    linear-gradient(180deg, #031126 0%, #020b1c 100%);
  color: #eef4ff;
}
.app-shell { min-height: 100vh; padding: 26px 14px 40px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; }
.hero { margin-bottom: 22px; }
.eyebrow { color: #5ce6d6; font-size: 14px; font-weight: 800; letter-spacing: 4px; margin-bottom: 10px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(40px, 7vw, 76px); font-weight: 900; line-height: 1; letter-spacing: -2px; }
.subtext { margin: 0; max-width: 980px; color: #aab7d3; font-size: clamp(15px, 2.6vw, 19px); line-height: 1.7; }

.glass { background: rgba(16, 24, 46, 0.70); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 12px 40px rgba(0,0,0,0.24); }
.card { border-radius: 24px; padding: 22px; }
.login-card { margin-top: 24px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-title-row h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.section-badge { font-size: 12px; color: #7eeadf; border: 1px solid rgba(126, 234, 223, 0.28); padding: 7px 10px; border-radius: 999px; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { color: #9fb0d1; font-size: 14px; font-weight: 700; }
.form-group input { width: 100%; height: 60px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.08); background: rgba(4, 10, 24, 0.75); color: #fff; font-size: 18px; padding: 0 18px; outline: none; }
.form-group input::placeholder { color: #6f7d99; }

.primary-btn, .play-btn, .ghost-btn, .modal-x, .chat-send-btn, .dice-btn, .beg-btn {
  border: none; outline: none; cursor: pointer; transition: 0.18s ease; font-weight: 800;
}
.primary-btn:active, .play-btn:active, .ghost-btn:active, .modal-x:active, .chat-send-btn:active, .dice-btn:active, .beg-btn:active { transform: scale(0.98); }
.login-btn { width: 100%; margin-top: 18px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, #19d7c3 0%, #3e7bff 100%); color: white; font-size: 18px; }

.top-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.user-info-wrap { display: flex; flex-direction: column; gap: 6px; }
.nickname { font-size: 16px; color: #9fb0d1; font-weight: 700; }
.balance { font-size: 28px; font-weight: 900; letter-spacing: -0.6px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ghost-btn { height: 44px; padding: 0 16px; border-radius: 14px; background: rgba(255,255,255,0.06); color: #dbe8ff; font-size: 14px; border: 1px solid rgba(255,255,255,0.08); }
.danger-outline { color: #ff8e8e; border-color: rgba(255,100,100,0.20); }

.main-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.bottom-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-top: 18px; }
.slot-panel, .side-panel, .chat-panel, .online-panel { min-height: 340px; }

.slot-list { display: flex; flex-direction: column; gap: 14px; }
.slot-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025)); border: 1px solid rgba(255,255,255,0.06); }
.vip-row { border-color: rgba(126, 234, 223, 0.22); }
.slot-left { min-width: 0; }
.slot-name { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.slot-meta { color: #94a4c5; font-size: 14px; }
.slot-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.slot-price { font-size: 15px; color: #7eeadf; font-weight: 800; min-width: 108px; text-align: right; }
.play-btn { min-width: 108px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #1be0ca 0%, #2d64ff 100%); color: white; font-size: 15px; }
.vip-btn { background: linear-gradient(135deg, #37f3d7 0%, #38a3ff 100%); }

.dice-card { display: flex; flex-direction: column; gap: 14px; }
.dice-info { color: #cdd8ef; line-height: 1.7; }
.dice-stage {
  position: relative;
  height: 220px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dice-stage.shake { animation: stageShake 0.45s ease; }
.dice-stage.flash { box-shadow: inset 0 0 24px rgba(255,216,77,0.25), 0 0 20px rgba(255,216,77,0.18); }
.dice-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.dice-image.spin { animation: diceSpin 0.15s linear infinite; }
.hidden-dice { display: none; }
.dice-fallback {
  font-size: 72px;
  opacity: 0.9;
}
.dice-fallback.spin { animation: diceSpin 0.15s linear infinite; }
.dice-result {
  min-height: 64px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  line-height: 1.7;
}
.dice-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dice-btn { height: 54px; border-radius: 16px; color: #fff; font-size: 18px; }
.odd-btn { background: linear-gradient(135deg, #7b61ff 0%, #4f46e5 100%); }
.even-btn { background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%); }
.beg-btn { height: 52px; border-radius: 16px; background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); color: #fff; font-size: 16px; }
.hidden-btn { display: none !important; }

.scroll-box, .chat-box, .online-box {
  display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding-right: 4px;
}
.rank-item, .chat-item, .online-item, .empty-text {
  padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.04); color: #d6e2f7; line-height: 1.5; font-size: 14px; border: 1px solid rgba(255,255,255,0.04);
}
.empty-text { color: #8b9ab9; }
.chat-name.color-0 { color: #7eeadf; }
.chat-name.color-1 { color: #ffb86c; }
.chat-name.color-2 { color: #bd93f9; }
.chat-name.color-3 { color: #ff79c6; }
.chat-name.color-4 { color: #8be9fd; }
.chat-name.color-5 { color: #f1fa8c; }
.chat-name.color-6 { color: #50fa7b; }
.chat-name.color-7 { color: #ff5555; }
.chat-item .chat-name { font-weight: 800; margin-right: 6px; }
.chat-item .chat-time, .online-item .online-time { color: #8b9ab9; font-size: 12px; display: block; margin-top: 4px; }
.chat-input-row { display: grid; grid-template-columns: 1fr 100px; gap: 10px; margin-top: 14px; }
.chat-input { width: 100%; height: 48px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: rgba(4, 10, 24, 0.75); color: #fff; font-size: 15px; padding: 0 14px; outline: none; }
.chat-send-btn { height: 48px; border-radius: 14px; background: linear-gradient(135deg, #19d7c3 0%, #3e7bff 100%); color: #fff; font-size: 15px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.82); display: flex; justify-content: center; align-items: center; padding: 18px; z-index: 9999; }
.modal.hidden { display: none !important; }
.modal-content { width: 100%; max-width: 540px; background: linear-gradient(180deg, #101624 0%, #0c1220 100%); border: 1px solid rgba(255,255,255,0.08); border-radius: 28px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,0.45); }
.modal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-title { font-size: 16px; color: #7eeadf; font-weight: 900; letter-spacing: 2px; }
.modal-x { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,0.06); color: #fff; font-size: 16px; }
.reels { display: flex; justify-content: center; gap: 12px; margin: 18px 0 22px; flex-wrap: nowrap; }
.reel { width: 82px; height: 96px; border-radius: 18px; background: #060a14; border: 1px solid rgba(255,255,255,0.06); display: flex; justify-content: center; align-items: center; font-size: 42px; box-shadow: inset 0 0 12px rgba(0,0,0,0.5); }
.reel.spinning { animation: reelPulse 0.16s infinite alternate; }
@keyframes reelPulse { from { transform: translateY(-2px); } to { transform: translateY(2px); } }
.modal-result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-result { font-size: 26px; font-weight: 900; }
.modal-profit { color: #ffd84d; font-size: 28px; font-weight: 900; }
.modal-sub { font-size: 16px; color: #9fb0d1; line-height: 1.6; }

@keyframes diceSpin {
  from { transform: rotate(0deg) scale(0.95); }
  to { transform: rotate(360deg) scale(1.04); }
}
@keyframes stageShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

@media (max-width: 980px) {
  .main-grid, .bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .form-grid, .chat-input-row { grid-template-columns: 1fr; }
  .slot-row { flex-direction: column; align-items: stretch; }
  .slot-right { justify-content: space-between; }
  .reel { width: 68px; height: 88px; font-size: 36px; }
}
