* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: #0b0e14;
  color: #e6e9ef;
}

header {
  padding: 16px 24px 8px;
}

header h1 {
  margin: 0;
  font-size: 24px;
  color: #ffd166;
}

header p {
  margin: 4px 0 0;
  color: #8b93a3;
  font-size: 14px;
}

main {
  display: grid;
  grid-template-columns: 290px 1fr 260px;
  gap: 16px;
  padding: 16px 24px 24px;
  align-items: start;
}

.panel {
  background: #151a23;
  border: 1px solid #252c3a;
  border-radius: 12px;
  padding: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #ffd166;
}

.panel h2:not(:first-child) {
  margin-top: 20px;
}

label {
  display: block;
  font-size: 13px;
  color: #aab2c2;
  margin-bottom: 12px;
}

label b {
  color: #fff;
  float: right;
}

input[type="text"],
select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  background: #0b0e14;
  color: #e6e9ef;
  border: 1px solid #2c3445;
  border-radius: 6px;
  font: inherit;
}

input[type="range"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  accent-color: #e5484d;
}

input[type="color"] {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: 4px;
  padding: 0;
  background: none;
  border: 1px solid #2c3445;
  border-radius: 6px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#preview {
  width: 100%;
  background: #0b0e14;
  border-radius: 8px;
}

button {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
  background: #e5484d;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: #f2555a; }
button:disabled { background: #4a2a2c; cursor: not-allowed; }

button.ghost {
  margin-top: 8px;
  font-size: 13px;
  font-weight: normal;
  background: transparent;
  border: 1px solid #2c3445;
  color: #aab2c2;
}

.hint {
  font-size: 13px;
  color: #8b93a3;
  margin: 0 0 10px;
}

#stage {
  position: relative;
}

#world {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #252c3a;
  cursor: crosshair;
}

#countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: bold;
  color: #ffd166;
  text-shadow: 0 0 30px #e5484d;
  pointer-events: none;
}

#result dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 13px;
}

#result dt { color: #8b93a3; }
#result dd { margin: 0; text-align: right; color: #fff; }

#log {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #aab2c2;
  max-height: 220px;
  overflow: auto;
}

#log li { margin-bottom: 6px; }

@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; }
}
