/* Discord Server Rules Poster Generator — styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 32px 20px 16px;
  background: #16162a;
  border-bottom: 1px solid #2a2a4a;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #5865F2;
  margin-bottom: 6px;
}

.tagline {
  font-size: 15px;
  color: #999;
}

main {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Controls panel */
.controls {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input[type="text"],
.field select {
  background: #252540;
  border: 1px solid #3a3a5c;
  border-radius: 8px;
  color: #eee;
  font-size: 15px;
  padding: 10px 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.field input[type="text"]:focus,
.field select:focus {
  border-color: #5865F2;
}

.field input[type="color"] {
  width: 60px;
  height: 36px;
  border: 2px solid #3a3a5c;
  border-radius: 8px;
  background: #252540;
  cursor: pointer;
  padding: 2px;
}

/* Rules list */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.rule-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rule-item input[type="text"] {
  flex: 1;
  background: #252540;
  border: 1px solid #3a3a5c;
  border-radius: 8px;
  color: #eee;
  font-size: 14px;
  padding: 8px 10px;
  font-family: inherit;
  outline: none;
}

.rule-item input[type="text"]:focus {
  border-color: #5865F2;
}

.rule-item .rule-emoji {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  background: #252540;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rule-item .rule-emoji:hover {
  border-color: #5865F2;
}

.rule-item .rule-remove {
  width: 28px;
  height: 28px;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  background: #252540;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rule-item .rule-remove:hover {
  background: #c44;
  border-color: #c44;
  color: #fff;
}

.add-rule-btn {
  background: transparent;
  border: 1px dashed #3a3a5c;
  border-radius: 8px;
  color: #999;
  padding: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s, color 0.2s;
}

.add-rule-btn:hover {
  border-color: #5865F2;
  color: #5865F2;
}

/* Emoji picker grid */
.emoji-picker-grid {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.emoji-picker-grid button {
  width: 30px;
  height: 30px;
  font-size: 16px;
  border: 1px solid #3a3a5c;
  border-radius: 5px;
  background: #252540;
  cursor: pointer;
  line-height: 1;
}

.emoji-picker-grid button:hover {
  border-color: #5865F2;
  background: #2a2a4a;
}

/* Theme presets */
.theme-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-preset {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #3a3a5c;
  cursor: pointer;
  transition: border-color 0.2s;
}

.theme-preset:hover,
.theme-preset.active {
  border-color: #5865F2;
}

/* Size selector */
.size-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.size-btn {
  padding: 6px 14px;
  border: 2px solid #3a3a5c;
  border-radius: 8px;
  background: #252540;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s;
}

.size-btn:hover { border-color: #5865F2; }
.size-btn.active { border-color: #5865F2; background: #5865F2; color: #fff; }

/* Preview panel */
.preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#posterCanvas {
  width: 100%;
  max-width: 533px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: block;
}

#downloadBtn {
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#downloadBtn:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

#downloadBtn:active {
  transform: translateY(0);
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: #666;
  border-top: 1px solid #2a2a4a;
}

footer a {
  color: #5865F2;
  text-decoration: none;
}

/* Mobile */
@media (max-width: 768px) {
  main {
    flex-direction: column;
  }
  .controls {
    flex: none;
    width: 100%;
  }
  #posterCanvas {
    max-width: 100%;
  }
}
