/* Base Reset & Variables */
:root {
    --color-bg: #f9f7fe;
    --color-surface: #ffffff;
    --color-primary: #6c3eb8;
    --color-primary-hover: #5a2fa3;
    --color-secondary: #f0566a;
    --color-text: #2d2a3a;
    --color-text-light: #5e5a6e;
    --color-border: #e0dcec;
    --color-accent: #3ec8b0;
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 12px;
    --max-width: 960px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 1rem;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.site-header {
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
}
.logo-icon {
    font-size: 1.5rem;
}
.site-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}
.site-nav a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: color var(--transition);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--color-primary);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #6c3eb8 0%, #f0566a 100%);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}
.btn-primary {
    background: #fff;
    color: var(--color-primary);
}
.btn-primary:hover {
    background: #f0e6ff;
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-secondary:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Mapper Section */
.mapper-section {
    padding: 2.5rem 0;
}
.mapper-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}
.mapper-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 700px) {
    .mapper-layout {
        grid-template-columns: 1fr;
    }
}
.character-selector {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.character-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-bg);
    margin-bottom: 1.5rem;
}
.preset-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.preset-btn {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
}
.preset-btn:hover,
.preset-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.result-panel {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-height: 200px;
}
.empty-state {
    color: var(--color-text-light);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}
.result-card {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}
.color-identity {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}
.color-symbol {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 0.8rem;
}
.color-W { background: #f9f1d9; color: #000; }
.color-U { background: #aae0fa; color: #000; }
.color-B { background: #a69f9c; color: #000; }
.color-R { background: #f9aa8f; color: #000; }
.color-G { background: #9bd3ae; color: #000; }

.commander-box {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.commander-box strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.strategy-box {
    margin-bottom: 1rem;
}
.strategy-box h4 {
    margin-bottom: 0.25rem;
}
.notes-box {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.action-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Saved Section */
.saved-section {
    background: var(--color-surface);
    padding: 2.5rem 0;
}
.saved-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}
.saved-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}
.saved-item {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
}
.saved-item h4 {
    color: var(--color-primary);
}
.saved-item .remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-secondary);
}

/* Info Section */
.info-section {
    padding: 2.5rem 0;
}
.info-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.info-card {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.info-card h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}
.example-walkthrough,
.assumptions,
.faq-block {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}
.example-walkthrough h3,
.assumptions h3,
.faq-block h3 {
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}
.faq-block dl {
    display: grid;
    gap: 1rem;
}
.faq-block dt {
    font-weight: 600;
}
.faq-block dd {
    margin-left: 1rem;
    color: var(--color-text-light);
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-light);
}
.site-footer nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 1.5rem;
    margin: 1rem 0;
}
.site-footer a {
    color: var(--color-primary);
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}
.version {
    font-size: 0.8rem;
}

/* About page specific */
.about-content {
    padding: 2.5rem 0;
}
.about-content h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
