@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* ==========================================
   ⚡ MEGA POP LOTTO - DESIGN SYSTEM & STYLES
   ========================================== */

/* --- Foundational Tokens --- */
:root {
  --font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  
  /* Color Palette (Deep dark universe with rich electric accents) */
  --bg-color-main: #0a0813;
  --bg-color-deck: rgba(18, 14, 33, 0.7);
  --color-primary: #8a2be2;
  --color-primary-glow: rgba(138, 43, 226, 0.4);
  --color-accent: #ffd700;
  --color-accent-glow: rgba(255, 215, 0, 0.35);
  --color-neon-blue: #00e5ff;
  --color-neon-pink: #ff007f;
  --color-neon-green: #39ff14;
  
  /* Text Colors */
  --text-primary: #f8f9fa;
  --text-secondary: #a9a9cc;
  --text-muted: #6c757d;
  
  /* Borders and Blurs */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-blur: blur(16px);
  --radius-xlarge: 24px;
  --radius-large: 16px;
  --radius-medium: 12px;
  --radius-small: 8px;
  
  /* Lotto Ball Color Swatches */
  --ball-yellow: radial-gradient(circle at 35% 35%, #fff275 0%, #fbc02d 40%, #f57f17 100%);
  --ball-blue: radial-gradient(circle at 35% 35%, #64b5f6 0%, #1976d2 40%, #0d47a1 100%);
  --ball-red: radial-gradient(circle at 35% 35%, #ff8a80 0%, #d32f2f 40%, #b71c1c 100%);
  --ball-grey: radial-gradient(circle at 35% 35%, #cfd8dc 0%, #78909c 40%, #37474f 100%);
  --ball-green: radial-gradient(circle at 35% 35%, #81c784 0%, #388e3c 40%, #1b5e20 100%);
}

/* --- Base Reset & General Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color-main);
  background-image: 
    radial-gradient(at 10% 20%, rgba(138, 43, 226, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 229, 255, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(255, 0, 127, 0.08) 0px, transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Effects Canvas overlay */
.effects-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Header & Brand Styling --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: rgba(18, 14, 33, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-large);
  backdrop-filter: var(--glass-blur);
  margin-bottom: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  z-index: 100;
}

@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
  }
  .btn-toggle-settings-mobile {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    margin: 10px 0;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: var(--radius-medium);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
  }
  .btn-toggle-settings-mobile .toggle-arrow {
    transition: transform 0.3s ease;
  }
  .control-panel.show-settings {
    display: block !important;
    animation: slideDown 0.3s ease-out forwards;
  }
  .control-panel {
    display: none !important; /* 기본 숨김, 토글 시 보임 */
  }
  .mobile-action-buttons {
    display: flex !important;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
  }
  .mobile-action-buttons .btn {
    flex: 1;
    max-width: 180px;
  }
  /* 기존 PC용 control-panel 숨김 방지 */
  @media (min-width: 769px) {
    .control-panel { display: block !important; }
    .btn-toggle-settings-mobile { display: none !important; }
    .mobile-action-buttons { display: none !important; }
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container:hover {
  transform: scale(1.03);
}

.logo-icon {
  font-size: 1.8rem;
  text-shadow: 0 0 10px var(--color-primary-glow);
  animation: logo-pulsate 1.5s ease-in-out infinite alternate;
}

.logo-text {
  font-family: 'Pretendard Variable', Pretendard, sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 1px;
}

.logo-text .highlight {
  background: linear-gradient(45deg, var(--color-accent), var(--color-neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation Menu */
.app-nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: var(--radius-small);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover .nav-icon {
  transform: translateY(-2px);
}

.nav-btn.active {
  color: var(--color-accent);
  background: rgba(138, 43, 226, 0.15);
  box-shadow: inset 0 0 0 1px rgba(138, 43, 226, 0.3);
}

/* Sound Controller toggler */
.audio-control-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-trigger-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-large);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.login-trigger-btn:hover {
  background: rgba(138, 43, 226, 0.2);
  border-color: var(--color-primary);
  transform: scale(1.03);
}

.auth-icon {
  margin-right: 6px;
  transition: transform 0.2s ease;
}

.login-trigger-btn:hover .auth-icon {
  transform: rotate(-10deg) scale(1.05);
}

.audio-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.25s ease;
}

.audio-btn:hover {
  background: rgba(138, 43, 226, 0.2);
  border-color: var(--color-primary);
  transform: scale(1.05);
}

.audio-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hidden {
  display: none !important;
}

/* --- Container Components --- */
.app-main-content {
  flex-grow: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-pane.active {
  display: block;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-large);
  padding: 24px;
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* --- TAB 1: LIVE DRAW PANEL --- */
.draw-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

/* Grid Spanning */
.control-panel {
  grid-column: 1;
  grid-row: 1 / 3;
}

.machine-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 40px;
  min-height: 520px;
  padding: 30px;
}

.machine-core {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.live-log-panel {
  flex: 0 0 320px;
  height: 490px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-medium);
  border: 1px solid var(--glass-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.live-log-title {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
}

.live-log-counter-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: normal;
}

.live-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 5px;
}

.live-log-list::-webkit-scrollbar {
  width: 6px;
}
.live-log-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

.live-log-empty {
  color: var(--text-secondary);
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
}

@keyframes slideDownTicket {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 950px) {
  .machine-panel {
    flex-direction: column;
    gap: 30px;
    padding: 20px;
  }
}

.results-panel {
  grid-column: 2;
  grid-row: 2;
}

/* Form Styles inside Glass */
.panel-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: -6px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Custom Styled Select dropdown */
.custom-select-wrapper {
  position: relative;
}

.custom-select-wrapper select {
  width: 100%;
  background: rgba(18, 14, 33, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-small);
  font-family: var(--font-family);
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.3s;
}

.custom-select-wrapper select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

.custom-select-wrapper::after {
  content: '▼';
  font-size: 0.7rem;
  color: var(--text-secondary);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Range Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  background: transparent;
}
input[type="range"]:focus {
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
  border: 2px solid #fff;
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--color-primary), rgba(255, 255, 255, 0.15));
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}

/* Progress status */
.status-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-small);
  padding: 14px;
  margin-bottom: 24px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.status-label {
  color: var(--text-secondary);
}

.status-value {
  font-weight: 700;
  color: var(--color-neon-blue);
}

.status-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-neon-blue));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Buttons System */
.btn {
  font-family: var(--font-family);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-small);
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(45deg, var(--color-primary), #a03cff);
  color: var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(45deg, #ff8a00, var(--color-accent));
  color: #0c0812;
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(211, 47, 47, 0.2);
  color: #ff5252;
  border: 1px solid rgba(211, 47, 47, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(211, 47, 47, 0.4);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.btn-large {
  padding: 16px 24px;
  font-size: 1.05rem;
}

.btn-glow {
  animation: pulse-neon 2s infinite alternate;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Lottery Machine View --- */
.machine-wrapper {
  position: relative;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 40%, rgba(138, 43, 226, 0.05) 80%, rgba(138, 43, 226, 0.15) 100%);
  border: 2px solid rgba(138, 43, 226, 0.2);
  box-shadow: 
    0 0 40px rgba(138, 43, 226, 0.1),
    inset 0 0 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.1s ease; /* For camera shake */
}

#machine-canvas {
  border-radius: 50%;
  display: block;
}

.machine-tube-glowing {
  position: absolute;
  bottom: -5px;
  left: calc(50% - 30px);
  width: 60px;
  height: 70px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.2), rgba(0, 229, 255, 0.6));
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  border-top: 2px solid var(--color-neon-blue);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  pointer-events: none;
}

.glass-reflection {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 380px;
  height: 180px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 190px 190px 40px 40px;
  pointer-events: none;
}

.machine-info {
  text-align: center;
  margin-top: 16px;
}

.info-tag {
  background: rgba(57, 255, 20, 0.15);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: var(--color-neon-green);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  letter-spacing: 0.5px;
}

.machine-info h3 {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  margin-top: 8px;
  background: linear-gradient(90deg, #fff, #999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Camera Shake trigger */
.camera-shake {
  animation: shake 0.15s infinite;
}

/* --- Results Panel & Ball Slots --- */
.results-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.badge {
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-gold {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--color-accent);
}

.slots-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.slot-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-medium);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 120px;
  position: relative;
  transition: all 0.3s ease;
}

.slot-card.filled {
  border-style: solid;
  border-color: rgba(138, 43, 226, 0.3);
  background: rgba(138, 43, 226, 0.03);
}

.slot-num {
  font-family: 'Pretendard Variable', Pretendard, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slot-ball-holder {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
}

.empty-glow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

/* --- Lotto Ball Standard Styles --- */
.lotto-ball {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Pretendard Variable', Pretendard, sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 -6px 12px rgba(0, 0, 0, 0.3),
    inset 0 4px 10px rgba(255, 255, 255, 0.4);
  cursor: default;
  user-select: none;
  animation: ball-appear 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Subtle highlights for 3D sphere look */
.lotto-ball::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 10px;
  width: 14px;
  height: 8px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  transform: rotate(-15deg);
}

/* Official Color Ranges */
.lotto-ball.num-yellow { background: var(--ball-yellow); }
.lotto-ball.num-blue { background: var(--ball-blue); }
.lotto-ball.num-red { background: var(--ball-red); }
.lotto-ball.num-grey { background: var(--ball-grey); }
.lotto-ball.num-green { background: var(--ball-green); }

/* Ball sizing modifiers */
.size-small {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  box-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.4),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3),
    inset 0 2px 5px rgba(255, 255, 255, 0.4);
}
.size-small::after {
  top: 2px;
  left: 6px;
  width: 8px;
  height: 4px;
}

.size-medium {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}
.size-medium::after {
  top: 3px;
  left: 8px;
  width: 11px;
  height: 6px;
}

.size-xlarge {
  width: 90px;
  height: 90px;
  font-size: 2.2rem;
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.5),
    inset 0 -10px 20px rgba(0, 0, 0, 0.35),
    inset 0 6px 15px rgba(255, 255, 255, 0.5);
}
.size-xlarge::after {
  top: 8px;
  left: 20px;
  width: 25px;
  height: 12px;
}

/* --- Pop Zoom In Overlay --- */
.pop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 8, 19, 0.9);
  border-radius: var(--radius-large);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease forwards;
}

.pop-content {
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.flash-ring {
  position: absolute;
  top: 45px;
  left: 45px;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--color-neon-blue);
  box-shadow: 0 0 30px var(--color-neon-blue);
  animation: flash-zoom 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  pointer-events: none;
}

.pop-description {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-neon-blue);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  letter-spacing: 0.5px;
  animation: slideUpText 0.4s ease forwards;
}

/* --- Draw Complete Screen Overlay --- */
.draw-complete-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.95) 0%, rgba(10, 8, 19, 0.98) 100%);
  border-radius: var(--radius-large);
  z-index: 12;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  gap: 16px;
  animation: scaleUpDrawCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.complete-icon {
  font-size: 3rem;
  animation: bounce 1.2s infinite alternate;
}

.draw-complete-card h3 {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(45deg, var(--color-accent), var(--color-neon-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: -8px;
}

.draw-complete-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 420px;
}

.drawn-result-display {
  display: flex;
  gap: 12px;
  margin: 10px 0;
}

.complete-actions {
  margin-top: 10px;
}

/* --- TAB 2: WINNING NUMBERS VIEW & EDITOR --- */
.numbers-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.round-picker-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.round-picker-bar label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-round-step {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-small);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-round-step:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-accent);
}

.winning-display-board {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-medium);
  padding: 24px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.board-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #fff 0%, #888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.board-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.winning-balls-layout {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
}

.main-numbers-box, .bonus-number-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main-numbers-box h4, .bonus-number-box h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.balls-row {
  display: flex;
  gap: 8px;
}

.plus-sign {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 18px;
}

/* Form Styles for custom manager */
.custom-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.col-6 {
  flex: 1;
}

.custom-form input[type="number"],
.custom-form input[type="date"] {
  width: 100%;
  background: rgba(10, 8, 19, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: var(--radius-small);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all 0.3s;
}

.custom-form input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.number-input-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.input-lotto-val, .input-lotto-bonus-val {
  text-align: center;
  font-weight: 700;
}

.editor-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

/* --- TAB 3: MY HISTORY & STATISTICS --- */
.history-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-medium);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.03);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.text-gold { color: var(--color-accent) !important; }
.text-green { color: var(--color-neon-green) !important; }

.roi-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.roi-label {
  color: var(--text-secondary);
}

.roi-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
}

/* History list structure */
.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.history-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 10px 16px;
  border-radius: var(--radius-small);
  margin-bottom: 20px;
  width: fit-content;
}

.history-filters label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.history-items-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
}

/* Scrollbar Customization */
.history-items-grid::-webkit-scrollbar {
  width: 6px;
}
.history-items-grid::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
.history-items-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.empty-history-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.placeholder-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 16px;
}

.empty-history-placeholder h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-history-placeholder p {
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* Historical Ticket Card */
.history-ticket {
  background: rgba(18, 14, 33, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-medium);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
  position: relative;
}

.history-ticket:hover {
  border-color: rgba(138, 43, 226, 0.25);
  background: rgba(18, 14, 33, 0.7);
  transform: translateX(4px);
}

.ticket-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ticket-round {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
}

.ticket-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ticket-balls-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.balls-sub-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 4px;
}

.matching-indicator-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ticket-status-badge {
  min-width: 140px;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-small);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Match colors for prize brackets */
.prize-rank-1 {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--color-accent);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}
.prize-rank-2 {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--color-neon-blue);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}
.prize-rank-3 {
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid rgba(255, 0, 127, 0.4);
  color: var(--color-neon-pink);
}
.prize-rank-4 {
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(138, 43, 226, 0.4);
  color: #b388ff;
}
.prize-rank-5 {
  background: rgba(57, 255, 20, 0.15);
  border: 1px solid rgba(57, 255, 20, 0.4);
  color: var(--color-neon-green);
}
.prize-none {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.ticket-prize-amount {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.85;
}

.btn-delete-ticket {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

.btn-delete-ticket:hover {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.1);
}

/* Glowing outline for balls that MATCHED winning numbers! */
.lotto-ball.matched {
  box-shadow: 
    0 0 0 3px #fff,
    0 0 15px 5px var(--color-accent),
    inset 0 -6px 12px rgba(0, 0, 0, 0.3);
  animation: glow-rotate 2s linear infinite;
}

/* --- Celebration Modals --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 3, 10, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 520px;
  background: radial-gradient(circle at top, rgba(138, 43, 226, 0.25) 0%, rgba(18, 14, 33, 0.98) 80%);
  border: 1px solid rgba(138, 43, 226, 0.4);
  box-shadow: 0 15px 50px rgba(138, 43, 226, 0.3);
  z-index: 10;
  padding: 30px;
}

.modal-header {
  display: flex;
  justify-content: flex-end;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: var(--text-primary);
}

.celebration-emoji {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: swing 1s infinite alternate;
}

.celebration-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 14px;
}

.celebration-rank-badge {
  background: linear-gradient(45deg, #ff8a00, var(--color-accent));
  color: #0c0812;
  font-weight: 900;
  font-size: 1.3rem;
  padding: 8px 24px;
  border-radius: 30px;
  display: inline-block;
  margin-bottom: 14px;
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.celebration-text {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.justify-center {
  justify-content: center;
}

/* --- Responsive CSS media queries --- */
@media (max-width: 1024px) {
  .draw-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .control-panel {
    grid-column: 1;
    grid-row: auto;
  }
  .machine-panel {
    grid-column: 1;
    grid-row: auto;
  }
  .results-panel {
    grid-column: 1;
    grid-row: auto;
  }
  .numbers-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 75px; /* 하단 탭바로 인해 가려지는 영역 방지 */
  }

  .app-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px !important;
    margin-bottom: 12px !important;
  }
  
  .logo-container {
    gap: 6px !important;
  }

  .logo-icon {
    font-size: 1.25rem !important;
  }

  .logo-text {
    font-size: 1.15rem !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
  }

  /* 로그인 버튼을 그냥 아이콘으로 축소 */
  .login-trigger-btn {
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .login-trigger-btn #login-btn-text {
    display: none !important;
  }

  .login-trigger-btn .auth-icon {
    margin-right: 0 !important;
    width: 18px !important;
    height: 18px !important;
  }

  /* 사운드 버튼 크기 조율 */
  .audio-btn {
    width: 36px !important;
    height: 36px !important;
  }

  .audio-icon {
    width: 18px !important;
    height: 18px !important;
  }

  .audio-control-container {
    gap: 8px !important;
  }
  
  .app-nav {
    display: none !important; /* 상단 탭 숨김 */
  }

  /* 📱 모바일 하단 탭바 활성화 */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(18, 14, 33, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
    z-index: 9999;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  }

  .bottom-nav .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    width: 30%;
    height: 100%;
    transition: all 0.2s ease;
  }

  .bottom-nav .nav-btn .nav-icon {
    width: 20px;
    height: 20px;
  }

  .bottom-nav .nav-btn.active {
    color: var(--color-neon-blue);
    background: transparent;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    box-shadow: none;
  }

  .bottom-nav .nav-btn.active .nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 5px var(--color-neon-blue));
  }

  /* ⏰ 카운트다운 타이머 모바일 정렬 최적화 */
  .countdown-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: 14px;
    padding: 18px 15px !important;
  }

  .countdown-card h3 {
    text-align: center;
  }

  /* ⚙️ 모바일 화면 배치 순서(Order) 최적화 */
  .draw-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto;
    gap: 16px;
  }

  .countdown-card {
    order: 1;
  }

  .machine-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
    order: 2;
    padding: 15px !important;
    min-height: auto !important;
    gap: 20px !important;
  }

  .results-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
    order: 3;
    padding: 18px !important;
  }

  .control-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
    order: 4;
    padding: 18px !important;
  }

  /* 챔버 크기 반응형 조율 */
  .machine-wrapper {
    width: 290px;
    height: 290px;
    max-width: 100%;
  }

  #machine-canvas {
    width: 290px;
    height: 290px;
    max-width: 100%;
  }

  .glass-reflection {
    width: 250px;
    height: 120px;
  }

  .live-log-panel {
    flex: 1 1 auto;
    width: 100%;
    height: 280px;
  }

  /* 🔮 모바일 1줄 로또 볼 슬롯 */
  .slots-container {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px !important;
  }

  .slot-card {
    padding: 10px 4px !important;
    min-height: 80px !important;
    border-radius: var(--radius-small) !important;
  }

  .slot-card .empty-glow {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.9rem !important;
  }

  .slot-card .lotto-ball {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.95rem !important;
    box-shadow: 
      0 2px 5px rgba(0, 0, 0, 0.4),
      inset 0 -4px 8px rgba(0, 0, 0, 0.3),
      inset 0 2px 4px rgba(255, 255, 255, 0.4) !important;
  }

  .slot-card .lotto-ball::after {
    top: 2px !important;
    left: 6px !important;
    width: 8px !important;
    height: 4px !important;
  }

  /* 기타 모바일 뷰 조율 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .winning-balls-layout {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .plus-sign {
    margin: 4px 0 !important;
    transform: rotate(90deg) !important;
    font-size: 1.2rem !important;
  }

  /* 📅 모바일 당첨번호 화면 최적화 */
  .round-picker-bar {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  .round-picker-bar label {
    white-space: nowrap !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
    color: var(--text-secondary);
  }

  .round-picker-bar .custom-select-wrapper {
    flex: 1 1 auto !important;
    min-width: 60px !important;
    width: auto !important;
  }

  .round-picker-bar select {
    font-size: 0.78rem !important;
    padding: 6px 20px 6px 8px !important;
  }

  .btn-round-step {
    padding: 7px 8px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .winning-display-board {
    padding: 16px 12px !important;
  }

  .board-header {
    flex-direction: column !important;
    gap: 4px !important;
    align-items: center !important;
    margin-bottom: 14px !important;
  }

  .board-title {
    font-size: 1.5rem !important;
    white-space: nowrap !important;
  }

  .board-date {
    font-size: 0.72rem !important;
  }

  /* 당첨번호 구슬 크기 및 줄바꿈 방지 */
  .winning-balls-layout .balls-row {
    display: flex !important;
    gap: 4px !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  .winning-balls-layout .lotto-ball {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
    line-height: 32px !important;
  }

  .winning-balls-layout h4 {
    font-size: 0.75rem !important;
    margin-bottom: 6px !important;
  }

  /* 당첨결과 상세 리스트 콤팩트화 */
  .winning-details-card {
    padding: 16px 12px !important;
  }

  .prize-row-sim {
    padding: 10px 12px !important;
    font-size: 0.82rem !important;
  }

  .prize-row-sim .prize-rank-badge {
    font-size: 0.75rem !important;
    padding: 2px 6px !important;
  }

  .prize-row-sim .prize-winner-count {
    font-size: 0.75rem !important;
  }

  .prize-row-sim .prize-win-amount {
    font-size: 0.85rem !important;
  }

  .history-ticket {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px !important;
  }

  .ticket-balls-section {
    width: 100%;
    justify-content: space-between;
  }

  .btn-delete-ticket {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  /* ⚙️ 번호 고정 추천 시스템 모바일 최적화 */
  .fixed-numbers-section > div:last-of-type {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  #fixed-balls-display {
    justify-content: center !important;
    flex-grow: 1;
  }

  #btn-open-fixed {
    width: 100% !important;
    margin-top: 4px;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
  }

  #fixed-numbers-grid {
    grid-template-columns: repeat(5, 1fr) !important; /* 모바일 기기 화면 폭을 고려해 5열 배열 */
    gap: 6px !important;
    max-height: 280px !important; /* 모바일 세로 높이 오버플로우 방지 */
    overflow-y: auto !important;
    padding: 8px 4px !important;
  }

  .fixed-ball-item {
    padding: 4px 2px !important;
  }

  .fixed-ball-item .lotto-ball.size-small {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.8rem !important;
  }

  .fixed-ball-stats {
    font-size: 0.58rem !important; /* 모바일에서 텍스트 줄바꿈/겹침 깨짐 방지 */
  }

  .history-items-grid {
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
  }

  /* 📱 내 이력 페이지 모바일 텍스트, 구슬, 아이콘 최적화 */
  .panel-header-row {
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .panel-title-group h2 {
    font-size: 0.95rem !important;
    margin-bottom: 8px !important; /* 타이틀 밑 간격을 넓혀 설명글과 분리 */
  }

  .panel-subtitle {
    font-size: 0.72rem !important;
    line-height: 1.3 !important;
  }

  /* 회차 필터 한 라인 정렬 */
  .history-filters {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 16px !important;
  }

  .history-filters label {
    white-space: nowrap !important;
    font-size: 0.85rem !important;
    flex-shrink: 0 !important;
  }

  .history-filters .custom-select-wrapper {
    flex-grow: 1 !important;
    width: auto !important;
  }

  /* 전체 삭제 버튼 모바일 아이콘화 */
  #btn-clear-history {
    padding: 0 !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    min-width: auto !important;
  }

  #btn-clear-history .btn-text {
    display: none !important;
  }

  #btn-clear-history .btn-icon {
    margin-right: 0 !important;
    display: inline-block;
  }

  /* 추천 기록 카드 모바일 최적화 */
  .history-ticket {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    position: relative !important;
  }

  .ticket-meta {
    gap: 2px !important;
    margin-bottom: 2px !important;
  }

  .ticket-round {
    font-size: 0.92rem !important;
  }

  .ticket-date {
    font-size: 0.68rem !important;
  }

  .ticket-balls-section {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px !important;
  }

  .balls-sub-label {
    font-size: 0.65rem !important;
    text-align: left !important;
    margin-bottom: 4px !important;
  }

  .balls-row {
    display: flex !important;
    gap: 3px !important;
    flex-wrap: wrap !important;
  }

  /* 이력 구슬 크기 극대 콤팩트화 */
  .history-ticket .lotto-ball.size-small {
    width: 27px !important;
    height: 27px !important;
    font-size: 0.75rem !important;
    line-height: 27px !important;
  }

  /* 공식 당첨 번호 배치 최적화 */
  .matching-indicator-box {
    align-items: flex-start !important;
    width: 100% !important;
  }

  /* 결과 뱃지 컴팩트화 */
  .ticket-status-badge {
    min-width: auto !important;
    width: 100% !important;
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
    border-radius: var(--radius-small) !important;
    margin-top: 2px !important;
  }

  .ticket-prize-amount {
    font-size: 0.62rem !important;
    margin-top: 1px !important;
  }

  .btn-delete-ticket {
    top: 10px !important;
    right: 10px !important;
    padding: 6px !important;
  }
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes logo-pulsate {
  from { text-shadow: 0 0 10px var(--color-primary-glow); }
  to { text-shadow: 0 0 25px var(--color-primary), 0 0 10px var(--color-neon-blue); }
}

@keyframes pulse-neon {
  0% { box-shadow: 0 0 5px var(--color-primary-glow), 0 0 0px var(--color-primary-glow); }
  100% { box-shadow: 0 0 20px var(--color-primary-glow), 0 0 8px var(--color-primary); }
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes ball-appear {
  0% { opacity: 0; transform: scale(0.3) rotate(-180deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes flash-zoom {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; border-width: 1px; }
}

@keyframes slideUpText {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUpDrawCard {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

@keyframes glow-rotate {
  0% { box-shadow: 0 0 0 3px #fff, 0 0 10px 4px var(--color-accent); }
  50% { box-shadow: 0 0 0 4px #fff, 0 0 20px 8px var(--color-accent); }
  100% { box-shadow: 0 0 0 3px #fff, 0 0 10px 4px var(--color-accent); }
}

@keyframes swing {
  0% { transform: rotate(10deg); }
  100% { transform: rotate(-10deg); }
}

/* --- Footer Copyright Section --- */
.app-footer {
  margin-top: 50px;
  padding: 24px 20px;
  text-align: center;
  background: rgba(18, 14, 33, 0.55);
  border-top: 1px solid var(--glass-border);
  border-radius: var(--radius-large) var(--radius-large) 0 0;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.app-footer p {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-footer p span {
  color: var(--color-accent);
}

/* ============================================================================
   👤 ULTRA-CONVENIENT USER LOGIN & GLASSMORPHIC MODAL STYLES
   ============================================================================ */

.login-trigger-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 30px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.login-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-neon-blue);
  color: var(--color-neon-blue);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  transform: translateY(-1px);
}

/* Modal Overlay Layer */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 4, 9, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: all 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Glassmorphism Card for Login */
.login-modal-card {
  width: 100%;
  max-width: 420px;
  background: rgba(18, 14, 33, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-large);
  padding: 35px 30px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 
              0 0 40px rgba(138, 43, 226, 0.15);
  animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-modal-btn:hover {
  color: var(--color-neon-pink);
}

.modal-header {
  text-align: center;
  margin-bottom: 25px;
}

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(45deg, #fff 30%, var(--color-neon-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Premium Neon Input style */
.custom-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-small);
  color: #fff;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all 0.25s ease;
  outline: none;
}

.custom-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.25), 
              inset 0 0 5px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.6);
}

.custom-input[type="password"] {
  letter-spacing: 6px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.help-text {
  line-height: 1.4;
}

.login-error {
  background: rgba(255, 0, 127, 0.08);
  border: 1px solid rgba(255, 0, 127, 0.2);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  text-align: center;
  margin-bottom: 15px;
  animation: shake 0.3s ease;
}

/* 📱 데스크톱 기본 모바일 하단바 숨김 처리 */
.bottom-nav {
  display: none;
}

/* 👑 CELEBRATION MODAL OVERLAY & POPUP STYLES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 5, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000; /* effects-canvas(9999) 간섭 방지를 위해 대폭 상향 */
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.hidden {
  display: none !important;
}

/* 🎨 Custom Keyframe Animations for Progressive Ball Pop & Live insertion */
@keyframes popScaleIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideDownTicket {
  0% {
    opacity: 0;
    transform: translateY(-15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Number Stats Board Table Scrollbar Customization --- */
.stats-table-wrapper::-webkit-scrollbar {
  width: 6px;
}
.stats-table-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.stats-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.stats-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
