/* Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: #120e0a;
  background-image: radial-gradient(circle at center, #231d16 0%, #120e0a 100%);
  color: #f5f5f5;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Smartphone size fixed frame */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 450px;
  max-height: 900px;
  aspect-ratio: 9 / 16;
  background-color: #2c251c;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  #app-container {
    border-radius: 32px;
    height: 94vh;
  }
}

/* Canvas stretching */
#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* UI Overlays styling */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* Settings View overlay */
#settings-overlay {
  background-color: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-direction: column;
  padding: 32px;
  overflow-y: auto;
}

/* Settings elements styling */
.settings-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.close-btn {
  background: none;
  border: none;
  color: #9e9e9e;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
  color: #f5f5f5;
  transform: scale(1.1);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-label {
  font-size: 16px;
  font-weight: 500;
  color: #f5f5f5;
}

.setting-hint {
  font-size: 11px;
  color: #616161;
  margin-top: 4px;
  line-height: 1.4;
}

/* Language & Selector options chips */
.chip-group {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid #424242;
  border-radius: 20px;
  color: #616161;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip.active {
  background: rgba(144, 202, 249, 0.18);
  border-color: #90caf9;
  color: #90caf9;
  font-weight: bold;
}

.chip:hover:not(.active) {
  border-color: #757575;
  color: #9e9e9e;
}

/* Premium toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #212121;
  border: 1px solid #424242;
  transition: .3s;
  border-radius: 28px;
}

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

input:checked + .slider {
  background-color: rgba(144, 202, 249, 0.18);
  border-color: #90caf9;
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #90caf9;
}

/* Divider & Branding */
.divider {
  height: 1px;
  background-color: #2c2c2c;
  margin: 16px 0;
}

.soyogi-title {
  color: #9e9e9e;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.soyogi-desc {
  color: #616161;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.soyogi-link {
  display: inline-block;
  color: #90caf9;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  padding: 4px 0;
}

/* Floating settings button on screen */
#settings-trigger {
  position: absolute;
  bottom: 48px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: color 0.2s ease, transform 0.2s ease;
}

#settings-trigger:hover {
  color: rgba(255, 255, 255, 0.95);
  transform: rotate(30deg);
}

/* Bottom support banner link */
#support-banner {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #5a5a5a;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  z-index: 5;
}

#support-banner:hover {
  color: #9e9e9e;
}

/* Drawing mode guide text */
#drawing-hint {
  position: absolute;
  bottom: 100px;
  left: 0;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  pointer-events: none;
  display: none;
}

/* Try touching hint text */
#first-hint {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  text-align: center;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* Popup modals styling (rest popups / shelter) */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  padding: 32px;
  flex-direction: column;
}

.modal-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
}

.modal-text-1 {
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 300;
  text-align: center;
  line-height: 1.8;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}

.modal-text-2 {
  color: #f5f5f5;
  font-size: 16px;
  font-weight: 300;
  text-align: center;
  line-height: 1.8;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}

/* Hotline block inside English Shelter popup */
.hotline-block {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hotline-desc {
  color: #f5f5f5;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 4px;
}

.hotline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #ccc;
}

.hotline-num {
  font-weight: bold;
  color: #f5f5f5;
  text-align: right;
}

.hotline-note {
  font-size: 10px;
  color: #9e9e9e;
}

.modal-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}

.btn-main {
  width: 100%;
  padding: 14px 20px;
  background-color: rgba(62, 39, 35, 0.8);
  border: 1px solid #ff8a65;
  border-radius: 12px;
  color: #ff8a65;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  font-family: inherit;
}

.btn-main:hover {
  background-color: rgba(62, 39, 35, 0.95);
  transform: scale(1.02);
}

.btn-secondary {
  background: none;
  border: none;
  color: #9e9e9e;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  color: #f5f5f5;
}

/* Showing animations classes */
.fade-in-up {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Material Settings icon */
.settings-icon-svg {
  fill: currentColor;
  width: 36px;
  height: 36px;
}
