:root {
  --bg: #0b1020;
  --panel: #111833;
  --panel-2: #182244;
  --line: rgba(255, 255, 255, 0.12);
  --text: #eff4ff;
  --muted: #aab6d3;
  --accent: #78a6ff;
  --accent-2: #9df3d5;
  --danger: #ffb4b4;
  --success: #9df3d5;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #0a1022 0%, #0f1630 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
}

.container {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(11, 16, 32, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}

.nav nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.logo,
.nav a {
  text-decoration: none;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

/* Hero */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 16px;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}

.hero-points span {
  font-size: 0.85rem;
  color: var(--accent-2);
  position: relative;
}

.hero-points span::before {
  content: '✓ ';
}

/* Tool section */
.tool-section {
  padding: 32px 0;
}

.input-area {
  margin-bottom: 24px;
}

.input-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--text);
}

textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.input-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 4px 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Platform grid */
.platforms-section {
  margin-bottom: 28px;
}

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

.platform-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.platform-checkbox:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}

.platform-checkbox input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.platform-badge {
  font-size: 1.2rem;
  line-height: 1;
}

.platform-label {
  font-size: 0.9rem;
  flex: 1;
}

.platform-limit {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Submit button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent), #4a7de0);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.loading {
  position: relative;
  pointer-events: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Status message */
.status-message {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.4em;
}

.status-message.error {
  color: var(--danger);
}

.status-message.success {
  color: var(--success);
}

/* Results */
.results-section {
  padding: 40px 0;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.2s;
}

.result-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.result-card-header .platform-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-card-header .platform-badge-lg {
  font-size: 1.4rem;
}

.result-card-header .platform-name {
  font-weight: 600;
  font-size: 1rem;
}

.result-card-header .char-info {
  font-size: 0.8rem;
  color: var(--muted);
}

.result-card-header .char-info.over-limit {
  color: var(--danger);
}

.result-card-body {
  padding: 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.result-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.btn-copy {
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  border-color: var(--accent);
  background: rgba(120, 166, 255, 0.1);
}

.btn-copy.copied {
  border-color: var(--success);
  color: var(--success);
}

/* Info section */
.info-section {
  padding: 56px 0;
}

.info-section h2 {
  text-align: center;
  font-size: 1.6rem;
  margin: 0 0 32px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.info-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
}

.info-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.info-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner a {
  color: var(--accent);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 600px) {
  .hero {
    padding: 40px 0 24px;
  }

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

  .result-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

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