@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-root: #070B14;
  --bg-surface: rgba(255,255,255,0.04);
  --bg-elevated: rgba(255,255,255,0.07);
  --bg-hover: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.10);
  --border-accent: rgba(34,197,94,0.45);
  --text-primary: #F2F7F2;
  --text-secondary: #A7B8AD;
  --text-muted: #6B7F72;
  --accent: #22C55E;
  --accent-dark: #16A34A;
  --accent-glow: rgba(34,197,94,0.22);
  --red: #F87171;
  --red-bg: rgba(248,113,113,0.12);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(34,197,94,0.18), transparent),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(22,163,74,0.10), transparent);
  background-attachment: fixed;
}

.app { max-width: 820px; margin: 0 auto; padding: 36px 20px 80px; }

header { text-align: center; margin-bottom: 28px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 8px; }
.brand-logo { height: 52px; width: auto; filter: drop-shadow(0 6px 18px rgba(34,197,94,0.35)); }
.brand-text { text-align: left; }
.brand-text h1 {
  font-size: 42px; font-weight: 800; letter-spacing: -1.5px; line-height: 1;
  background: linear-gradient(135deg, #DCFCE7 0%, #22C55E 55%, #16A34A 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.brand-badge {
  display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-glow); border: 1px solid var(--border-accent);
  color: #BBF7D0; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
header p { font-size: 14px; color: var(--text-muted); }
.hero-note { max-width: 560px; margin: 12px auto 0; color: var(--text-secondary); line-height: 1.6; }

.toolbar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 16px; padding: 8px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.toolbar select {
  flex: 1; min-width: 0; padding: 11px 14px; background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7F72' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center; background-repeat: no-repeat; background-size: 18px; padding-right: 36px;
}
.toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.toolbar button, .new-box button {
  padding: 11px 14px; background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.toolbar button:hover, .new-box button:hover { background: var(--bg-hover); color: var(--text-primary); }
.toolbar button:active, .new-box button:active { transform: scale(0.97); }
.toolbar button.danger { color: var(--red); background: var(--red-bg); border-color: transparent; }
.toolbar button.danger:hover { background: var(--red); color: #fff; }
#newBtn { background: linear-gradient(135deg, #22C55E, #16A34A); color: #04120A; border-color: transparent; box-shadow: 0 6px 20px var(--accent-glow); }

.new-box {
  margin-bottom: 16px; padding: 18px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; gap: 10px; flex-wrap: wrap; backdrop-filter: blur(12px);
}
.new-box.hidden { display: none; }
.new-box input {
  flex: 1; min-width: 220px; padding: 12px 16px; background: #070B14; color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; font-weight: 500;
}
.new-box input:focus, .new-box select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.new-box select { padding: 12px 14px; background: #070B14; color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: 'JetBrains Mono', monospace; cursor: pointer; }
#createCustomBtn { background: linear-gradient(135deg, #22C55E, #16A34A); color: #04120A; border-color: transparent; box-shadow: 0 6px 20px var(--accent-glow); }
#createRandomBtn { background: var(--bg-elevated); color: var(--text-primary); }

.panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(12px); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.panel-head h2 { font-size: 14px; font-weight: 700; font-family: 'JetBrains Mono', monospace; word-break: break-all; }
.panel-head span { font-size: 11px; font-weight: 700; color: #BBF7D0; white-space: nowrap; background: var(--accent-glow); border: 1px solid var(--border-accent); padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.3px; }
.message-list { min-height: 260px; }
.message-item { padding: 18px 20px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.message-item:last-child { border-bottom: none; }
.message-item:hover { background: var(--bg-hover); }
.message-item .message-meta { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.4px; }
.message-item strong { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.message-item p { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.7; word-break: break-word; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 16px; opacity: 0.5; }
.empty-state .title { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state .sub { font-size: 13px; max-width: 320px; line-height: 1.6; }

footer { text-align: center; padding: 32px 0 20px; font-size: 12px; color: var(--text-muted); line-height: 1.8; }
footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; background: #0F1A12; border: 1px solid var(--border-accent); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-primary); box-shadow: var(--shadow); }
.toast.fadeout { opacity: 0; transition: opacity 200ms; }

@media (max-width: 560px) {
  .app { padding: 20px 12px 60px; }
  .brand-text h1 { font-size: 34px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar select { width: 100%; flex: none; }
  .new-box { flex-direction: column; }
  .new-box input, .new-box select, .new-box button { width: 100%; }
  .panel-head { flex-direction: column; align-items: flex-start; }
}
