
:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --accent: #00CEC9;
  --accent-dark: #00B5B0;
  --bg: #0F0F1A;
  --bg-card: #1A1A2E;
  --bg-card-hover: #222240;
  --text: #E8E8F0;
  --text-muted: #9090A8;
  --border: #2A2A45;
  --success: #00E676;
  --warning: #FFD600;
  --danger: #FF5252;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}
a { color: var(--primary-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

/* Header */
.site-header {
  background: rgba(15,15,26,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.logo span { color: var(--primary); }
nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
nav a:hover, nav a.active { color: var(--accent); }

/* Language Switcher */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  display: flex; align-items: center; gap: 6px;
  transition: all .2s;
}
.lang-btn:hover { border-color: var(--primary); }
.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 160px;
  box-shadow: var(--shadow);
  z-index: 200;
}
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown { display: block; }
.lang-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: .9rem;
  transition: all .2s;
}
.lang-dropdown a:hover { background: var(--bg-card-hover); color: var(--text); }
.lang-dropdown a.current { color: var(--accent); font-weight: 600; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: linear-gradient(135deg, rgba(108,92,231,0.1), rgba(0,206,201,0.05));
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: .75rem; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--text-muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

/* Main */
main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 2rem; width: 100%; }

/* Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all .3s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(108,92,231,0.15);
}
.tool-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.tool-card h3 { font-size: 1.3rem; color: var(--text); margin-bottom: .5rem; }
.tool-card p { color: var(--text-muted); font-size: .95rem; flex: 1; }
.tool-card .arrow { color: var(--primary); font-size: 1.2rem; margin-top: 1rem; text-align: right; }

/* Timer Display */
.timer-container {
  text-align: center;
  padding: 2rem 0;
}
.timer-display {
  font-size: 6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin: 2rem 0;
  letter-spacing: 4px;
  text-shadow: 0 0 40px rgba(108,92,231,0.3);
}
.timer-display.warning { color: var(--warning); text-shadow: 0 0 40px rgba(255,214,0,0.3); }
.timer-display.danger { color: var(--danger); animation: pulse 1s infinite; text-shadow: 0 0 40px rgba(255,82,82,0.4); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.6; } }

/* Buttons */
.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 1.5rem 0; }
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: scale(1.03); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #E04040; }
.btn-success { background: var(--success); color: #111; }
.btn-success:hover { background: #00C866; }
.btn-accent { background: var(--accent); color: #111; }
.btn-accent:hover { background: var(--accent-dark); }

/* Inputs */
.input-group {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin: 1.5rem 0;
}
.input-field {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.input-field label { color: var(--text-muted); font-size: .85rem; font-weight: 500; }
.input-field input, .input-field select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  width: 100px;
  text-align: center;
  transition: border-color .2s;
}
.input-field input:focus, .input-field select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Quick Timer Links */
.quick-links {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center;
  margin: 2rem 0;
}
.quick-link {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 50px;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
}
.quick-link:hover { border-color: var(--primary); color: var(--text); background: var(--bg-card-hover); }

/* Laps Table */
.laps-container {
  max-width: 500px; margin: 2rem auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.laps-container h3 { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
.laps-list { max-height: 300px; overflow-y: auto; }
.lap-item {
  display: flex; justify-content: space-between;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.lap-item:nth-child(odd) { background: rgba(255,255,255,0.02); }

/* Pomodoro */
.pomodoro-status {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.status-work { background: rgba(108,92,231,0.2); color: var(--primary-light); }
.status-short { background: rgba(0,206,201,0.2); color: var(--accent); }
.status-long { background: rgba(0,230,118,0.2); color: var(--success); }
.pomodoro-settings {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 500px;
  margin: 2rem auto;
}
.pomodoro-settings h3 { margin-bottom: 1rem; font-size: 1rem; }
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem 0;
}
.setting-row label { color: var(--text-muted); font-size: .9rem; }
.setting-row input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  width: 80px;
  text-align: center;
  font-size: 1rem;
}
.session-dots { display: flex; gap: 8px; justify-content: center; margin: 1rem 0; }
.session-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--border);
  transition: background .3s;
}
.session-dot.completed { background: var(--primary); }
.session-dot.active { background: var(--accent); box-shadow: 0 0 10px rgba(0,206,201,0.5); }

/* Content sections */
.content-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.content-section h1, .content-section h2 { margin-bottom: 1rem; }
.content-section p { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.8; }

/* Ad slots */
.ad-slot {
  background: rgba(108,92,231,0.05);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  margin: 1.5rem 0;
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem;
}
.footer-inner a { color: var(--text-muted); font-size: .85rem; }
.footer-inner a:hover { color: var(--accent); }
.footer-copy { color: var(--text-muted); font-size: .8rem; margin-top: .75rem; }

/* Responsive */
@media (max-width: 768px) {
  .timer-display { font-size: 3.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .header-inner { flex-wrap: wrap; height: auto; padding: .75rem 0; gap: .5rem; }
  nav { gap: .75rem; }
  nav a { font-size: .85rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .input-group { flex-direction: row; }
  .input-field input { width: 80px; font-size: 1.1rem; }
  .btn { padding: 12px 24px; font-size: .95rem; }
}
@media (max-width: 480px) {
  .timer-display { font-size: 2.8rem; letter-spacing: 2px; }
  .site-header { padding: 0 1rem; }
  main { padding: 1rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
}


/* ═══════════════════════════════════════════════════════════
   SHARED TOOL STYLES — Litofania, Moon Lamp, etc.
   Uses the same CSS variables as Timer/Stopwatch/Pomodoro
   ═══════════════════════════════════════════════════════════ */

/* Tool page container */
.tool-page {
  text-align: center;
  padding: 1rem 0 2rem;
}
.tool-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.tool-page .tool-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Two-column layout (tool + controls) */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin: 1.5rem 0;
  text-align: left;
}
@media (max-width: 800px) {
  .tool-layout { grid-template-columns: 1fr; }
}

/* Upload area */
.tool-upload {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.tool-upload:hover, .tool-upload.dragover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}
.tool-upload .upload-icon { font-size: 56px; margin-bottom: 12px; }
.tool-upload h3 { color: var(--text); margin: 0 0 6px; font-size: 1.1rem; }
.tool-upload p { color: var(--text-muted); margin: 2px 0; font-size: .9rem; }
.tool-upload input[type=file] { display: none; }

/* Preview area (3D, canvas, etc.) */
.tool-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 350px;
}
.tool-preview canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.tool-preview-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  margin-top: 8px;
}

/* Loading overlay */
.tool-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  z-index: 5;
  background: rgba(15,15,26,.85);
}

/* Control panel */
.tool-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Control group (card-like) */
.ctrl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.ctrl-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-light);
}

/* Control row (label + slider/value) */
.ctrl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
  font-size: .9rem;
  color: var(--text);
}
.ctrl-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  margin-top: 4px;
}
.ctrl-row .ctrl-val {
  font-weight: 600;
  color: var(--primary-light);
  min-width: 50px;
  text-align: right;
}
.ctrl-row select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  margin-top: 4px;
}
.ctrl-row select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toggle buttons (Positive/Negative, Surface/Lamp, etc.) */
.toggle-bar {
  display: flex;
  gap: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 4px;
}
.toggle-bar button {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
}
.toggle-bar button.active {
  background: var(--primary);
  color: #fff;
}
.toggle-bar button:hover:not(.active) {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* Image adjustment row */
.adjust-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.adjust-row label {
  min-width: 90px;
  font-size: .9rem;
  color: var(--text-muted);
}
.adjust-row input[type=range] { flex: 1; accent-color: var(--primary); }
.adjust-row .val {
  min-width: 30px;
  text-align: right;
  font-size: .85rem;
  color: var(--primary-light);
  font-weight: 600;
}

/* Download button */
.tool-download-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  font-family: inherit;
}
.tool-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108,92,231,.35);
}
.tool-download-btn:disabled {
  opacity: .5;
  cursor: wait;
  transform: none;
}

/* STL info line */
.tool-stl-info {
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  min-height: 1.2em;
  margin-top: 6px;
}

/* Change image button */
.btn-change {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--bg-card);
  color: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit;
}
.btn-change:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

/* Tips/print guide section */
.tool-tips {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 2rem 0;
  text-align: left;
}
.tool-tips h2, .tool-tips h3 {
  color: var(--primary-light);
  margin: 0 0 12px;
}
.tool-tips p, .tool-tips li {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 6px;
}
.tool-tips strong { color: var(--text); }

/* FAQ section */
.tool-faq { margin: 2rem 0; text-align: left; }
.tool-faq h2 { color: var(--primary-light); margin-bottom: 16px; }
.faq-item {
  margin-bottom: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-item summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.faq-item summary:hover { background: var(--bg-card-hover); }
.faq-item p {
  padding: 0 18px 14px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Data credit */
.data-credit {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Settings grid (2-col) */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 500px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.setting-item label {
  display: block;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.setting-item input, .setting-item select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .2s;
}
.setting-item input:focus, .setting-item select:focus {
  border-color: var(--primary);
  outline: none;
}
