:root {
  --bg: #f6f8fb;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --accent: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  max-width: 1100px;
  margin: 20px auto 0;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 24px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

select,
button,
input {
  font: inherit;
}

select,
.ghost-btn,
.primary-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
}

.ghost-btn,
.primary-btn {
  cursor: pointer;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  margin: 12px 0;
  font-size: 34px;
}

.color-toolbar {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.color-toolbar-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(17, 24, 39, 0.3);
}

.screen-area {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  min-height: 420px;
}

.screen-wrap {
  position: relative;
}

.screen-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.fullscreen-fab,
.exit-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(17, 24, 39, 0.8);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.exit-fab {
  display: none;
  background: rgba(185, 28, 28, 0.88);
}

.icon {
  font-size: 14px;
  line-height: 1;
}

.help-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  margin-top: 20px;
  background: linear-gradient(135deg, #fff7ed 0%, #eef2ff 45%, #ecfeff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.16);
}

.controls-head {
  margin-bottom: 14px;
}

.controls h2 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 24px;
  background: linear-gradient(90deg, #7c3aed, #2563eb, #0f766e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}

.control-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82));
  border: 1px solid #cfd8ff;
  border-radius: 14px;
  padding: 12px;
}

.control-title {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4338ca;
  font-weight: 700;
}

.resolution-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resolution-buttons button {
  border: 1px solid #dbe4ff;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f8faff);
  padding: 8px 12px;
  cursor: pointer;
  color: #334155;
  font-weight: 600;
}

.resolution-buttons button.active,
.color-chip.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border-color: #5b21b6;
}

.color-chip.active .swatch {
  border-color: rgba(255, 255, 255, 0.75);
}

.pixel-inputs {
  display: flex;
  gap: 12px;
}

.pixel-inputs label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.pixel-inputs input {
  width: 160px;
  border-radius: 9px;
  border: 1px solid #c7d2fe;
  padding: 8px 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.pixel-inputs input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.action-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border-color: #5b21b6;
  font-weight: 600;
}

.action-btn {
  background: linear-gradient(180deg, #ffffff, #f8faff);
  border-color: #c7d2fe;
  color: #334155;
  font-weight: 600;
}

.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.usage {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.usage h2 {
  margin-top: 0;
}

.usage ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.faq-section {
  margin-top: 24px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.faq-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.faq-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.faq-card p {
  margin: 0;
  color: #64748b;
}

.site-footer {
  margin: 28px auto 24px;
  max-width: 1100px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  color: #334155;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: none;
}

.cookie-banner.show {
  display: block;
}

.cookie-content {
  max-width: 900px;
  margin: 0 auto;
  background: #111827;
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
}

.cookie-content p {
  margin: 0 0 10px;
  color: #e2e8f0;
}

.cookie-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-actions a {
  color: #93c5fd;
  text-decoration: none;
}

.cookie-actions a:hover {
  text-decoration: underline;
}

body.fullscreen-mode .site-header,
body.fullscreen-mode .controls,
body.fullscreen-mode .grid,
body.fullscreen-mode .usage,
body.fullscreen-mode .faq-section,
body.fullscreen-mode .site-footer,
body.fullscreen-mode .cookie-banner,
body.fullscreen-mode .color-toolbar,
body.fullscreen-mode h1 {
  display: none;
}

body.fullscreen-mode .container {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.fullscreen-mode .screen-area {
  border: none;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
}

body.fullscreen-mode .screen-tools {
  top: 16px;
  right: 16px;
  z-index: 5;
}

body.fullscreen-mode .fullscreen-fab {
  display: none;
}

body.fullscreen-mode .exit-fab {
  display: inline-flex;
}

@media (max-width: 760px) {
  h1 {
    font-size: 28px;
  }

  .screen-area {
    min-height: 280px;
  }

  .site-header {
    margin-top: 12px;
  }

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

  .pixel-inputs {
    flex-direction: column;
  }

  .pixel-inputs input {
    width: 100%;
  }
}
