:root {
  --bg-1: #041216;
  --bg-2: #193843;
  --panel: rgba(6, 20, 26, 0.68);
  --line: rgba(150, 223, 211, 0.35);
  --text: #e8fbff;
  --muted: #9dc4ca;
  --accent: #74f3c8;
  --accent-2: #ffd67a;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 18% 12%, #315f67 0%, transparent 36%),
    radial-gradient(circle at 80% 0%, #4a7d4f 0%, transparent 33%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
}

.app-shell {
  width: min(1100px, calc(100% - 2.5rem));
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1.2rem;
}

.hero,
.controls-panel,
.canvas-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero,
.controls-panel {
  padding: 1.25rem 1.35rem;
}

.tag {
  margin: 0 0 0.6rem;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.77rem;
}

h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.04;
}

.subtitle {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.controls-panel {
  display: grid;
  gap: 0.95rem;
}

.file-input-wrap,
.slider-wrap,
.button-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.slider-wrap label {
  min-width: 230px;
  color: var(--muted);
}

input[type="file"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

input[type="range"] {
  width: min(430px, 100%);
  accent-color: var(--accent);
}

.button {
  border: none;
  border-radius: 12px;
  padding: 0.72rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-primary {
  background: #e4f9ff;
  color: #092833;
}

.button-accent {
  background: linear-gradient(120deg, var(--accent), #8ddff1);
  color: #06343a;
}

.button-ghost {
  background: rgba(116, 243, 200, 0.16);
  color: var(--text);
  border: 1px solid rgba(116, 243, 200, 0.55);
}

#fileName {
  color: var(--muted);
}

.status {
  margin: 0;
  color: var(--accent-2);
}

.canvas-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.canvas-card {
  position: relative;
  padding: 1rem;
  min-height: 260px;
}

.canvas-card h2 {
  margin: 0 0 0.8rem;
  color: #ccf8f3;
  font-family: "Syne", sans-serif;
  font-size: 1.02rem;
}

canvas {
  width: 100%;
  height: auto;
  max-height: 60vh;
  border-radius: 12px;
  border: 1px solid rgba(157, 196, 202, 0.45);
  background: rgba(2, 9, 12, 0.75);
  position: relative;
  z-index: 2;
}

.checkerboard {
  position: absolute;
  inset: 3.15rem 1rem 1rem;
  border-radius: 12px;
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.09) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.09) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.09) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.09) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  z-index: 1;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(1100px, calc(100% - 1.25rem));
    margin: 1rem auto 1.25rem;
  }

  .canvas-grid {
    grid-template-columns: 1fr;
  }

  .slider-wrap label {
    min-width: 170px;
  }
}
