/* ════════════════════════════════════════════════════════════════════
   /create-character – noir "välj din väg" (matchar gw-public.css)
   ════════════════════════════════════════════════════════════════════ */
.cc {
    --text: #f2f4f7; --muted: #a3acb9; --dim: #7d8694; --line: rgba(255,255,255,.09);
    --panel: rgba(15, 17, 23, .82); --red: #ff3b3b; --red-2: #c81e1e; --gold: #f5c451;
    position: relative; isolation: isolate; overflow-x: clip; color: var(--text);
    max-width: 1240px; margin: 0 auto; padding: 28px 20px 48px; font-family: 'Roboto', system-ui, sans-serif;
}
.cc *, .cc *::before, .cc *::after { box-sizing: border-box; }
.cc :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* bakgrund: accentfärgad dimma som följer vald klass + rutnät */
.cc-bg { position: absolute; inset: -40px -20px 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cc-bg__glow { position: absolute; inset: -10% 0 auto; height: 720px;
    background: radial-gradient(700px 360px at 30% 10%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
                radial-gradient(600px 400px at 85% 30%, rgba(245,196,81,.10), transparent 70%);
    transition: background .6s ease; animation: cc-drift 18s ease-in-out infinite alternate; }
.cc-bg__grid { position: absolute; inset: 0; opacity: .35;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px; -webkit-mask-image: linear-gradient(#000, transparent 75%); mask-image: linear-gradient(#000, transparent 75%); }
.cc-bg { -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }

/* ── Hero ── */
.cc-hero { text-align: center; margin: 8px auto 34px; max-width: 760px; animation: cc-rise .7s cubic-bezier(.2,.8,.2,1) both; }
.cc-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,59,59,.35);
    background: rgba(255,59,59,.08); color: #ffb4ab; font: 700 11px/1 'Roboto', sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.cc-eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: cc-pulse 1.8s infinite; }
.cc-title { margin: 18px 0 12px; padding-top: .08em; font: 700 clamp(46px, 7.4vw, 92px)/1.02 'Oswald', sans-serif; letter-spacing: .02em; text-transform: uppercase;
    background: linear-gradient(180deg, #fff 0%, #c9ced6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cc-title span { background: linear-gradient(90deg, var(--gold), #ff8a3d 45%, var(--red)); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 28px rgba(255,59,59,.45)); }
.cc-lead { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.6; }

/* ── Layout ── */
.cc-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "pick preview" "pick cta"; gap: 22px 28px; align-items: start; }
.cc-pick { grid-area: pick; }
.cc-preview { grid-area: preview; }
.cc-cta-wrap { grid-area: cta; align-self: start; }
.cc-step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 15px/1 'Oswald', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #dfe3e9; }
.cc-step b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; color: #140606;
    background: linear-gradient(135deg, var(--gold), #ff8a3d); box-shadow: 0 0 18px rgba(245,196,81,.35); }

/* ── Klasskort ── */
.cc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cc-card { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    background: #0b0d12; color: inherit; font: inherit; text-align: left; cursor: pointer; isolation: isolate;
    transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .25s ease;
    animation: cc-rise .6s cubic-bezier(.2,.8,.2,1) both; }
.cc-card:nth-child(2) { animation-delay: .05s; } .cc-card:nth-child(3) { animation-delay: .1s; } .cc-card:nth-child(4) { animation-delay: .15s; }
.cc-card:nth-child(5) { animation-delay: .2s; } .cc-card:nth-child(6) { animation-delay: .25s; }
.cc-card__img, .cc-card__img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cc-card__img img { object-fit: cover; object-position: center 20%; filter: grayscale(.55) brightness(.62) contrast(1.05); transform: scale(1.02);
    transition: filter .35s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.cc-card__shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(5,6,9,.55) 60%, rgba(5,6,9,.96) 100%); }
.cc-card__body { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 3px; }
.cc-card__name { display: flex; align-items: center; gap: 7px; font: 700 20px/1.05 'Oswald', sans-serif; letter-spacing: .06em; }
.cc-card__emoji { font-size: 18px; }
.cc-card__tag { color: var(--muted); font-size: 12px; line-height: 1.3; }
.cc-card__badge { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 4px 8px; border-radius: 6px; font: 800 10px/1 'Roboto', sans-serif; letter-spacing: .1em;
    text-transform: uppercase; color: #1a1204; background: linear-gradient(135deg, var(--gold), #d69e2e); }
.cc-card__check { position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: #0a0a0a; box-shadow: 0 0 16px var(--accent); transform: scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.cc-card__check .mud-icon-root { font-size: 18px; }
.cc-card:hover:not(:disabled) { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--accent) 70%, transparent); }
.cc-card:hover .cc-card__img img { filter: grayscale(.1) brightness(.85); transform: scale(1.07); }
.cc-card.is-selected { border-color: var(--accent); transform: translateY(-4px);
    box-shadow: 0 0 0 2px var(--accent), 0 24px 60px -18px var(--accent), inset 0 0 40px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.cc-card.is-selected::after { content: ""; position: absolute; inset: -2px; border-radius: 19px; pointer-events: none; box-shadow: 0 0 0 2px var(--accent);
    animation: cc-ring 2.2s ease-out infinite; }
.cc-card.is-selected .cc-card__img img { filter: none; transform: scale(1.06); }
.cc-card.is-selected .cc-card__check { transform: scale(1); }
.cc-card.is-selected .cc-card__name { color: #fff; text-shadow: 0 0 18px var(--accent); }
.cc-card:disabled { cursor: default; }

/* ── Förhandsvisning ── */
.cc-preview { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel); backdrop-filter: blur(10px);
    box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); transition: box-shadow .5s ease; }
.cc-portrait { position: relative; height: 300px; overflow: hidden; background: #07080b; }
.cc-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
    animation: cc-reveal .6s cubic-bezier(.2,.8,.2,1) both, cc-kenburns 14s ease-in-out .6s infinite alternate; }
.cc-portrait__shade { position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(7,8,11,.1) 0%, transparent 35%, rgba(10,11,15,.94) 100%),
                radial-gradient(120% 80% at 50% 110%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%); }
.cc-portrait__lock { position: absolute; top: 14px; left: 14px; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #1a1204;
    background: linear-gradient(135deg, var(--gold), #d69e2e); }
.cc-portrait__id { position: absolute; left: 20px; right: 20px; bottom: 16px; display: flex; flex-direction: column; gap: 4px; animation: cc-rise .6s .1s cubic-bezier(.2,.8,.2,1) both; }
.cc-portrait__class { align-self: flex-start; padding: 4px 10px; border-radius: 999px; font: 700 11px/1.2 'Roboto', sans-serif; letter-spacing: .14em;
    color: #0a0a0a; background: var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); }
.cc-portrait__name { font: 700 clamp(30px, 3.4vw, 42px)/1.05 'Oswald', sans-serif; letter-spacing: .03em; text-transform: uppercase; color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,.8); overflow-wrap: anywhere; }
.cc-portrait__name.is-empty { color: rgba(255,255,255,.35); }
.cc-portrait__tag { color: #d5dae1; font-size: 13px; }

.cc-info { padding: 18px 20px 4px; animation: cc-rise .5s cubic-bezier(.2,.8,.2,1) both; }
.cc-note { display: inline-block; margin-bottom: 14px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #ffb36b;
    background: rgba(255,138,61,.08); border: 1px solid rgba(255,138,61,.22); }
.cc-stats { display: grid; gap: 7px; }
.cc-stat { display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 10px; }
.cc-stat__lbl { font: 700 11px/1 'Roboto', sans-serif; letter-spacing: .1em; color: var(--dim); }
.cc-stat__bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.cc-stat__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, transparent), var(--c));
    box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); animation: cc-grow .8s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.cc-stat__val { font: 700 13px/1 'Oswald', sans-serif; text-align: right; }
.cc-desc { margin: 14px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #cfd5dd; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.cc-chip--gold { color: var(--gold); border-color: rgba(245,196,81,.3); background: rgba(245,196,81,.07); }

/* ── Namn ── */
.cc-form { padding: 20px 20px 22px; margin-top: 16px; border-top: 1px solid var(--line); }
.cc-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #d5dae1; }
.cc-input-wrap { position: relative; }
.cc-input-wrap .cc-input-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 22px; pointer-events: none; }
.cc-input { width: 100%; height: 56px; padding: 0 64px 0 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(5,6,9,.8);
    color: var(--text); font: 600 18px/1 'Roboto', sans-serif; letter-spacing: .02em; transition: border-color .2s ease, box-shadow .2s ease; }
.cc-input::placeholder { color: #5b636f; font-weight: 400; }
.cc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 30px -8px var(--accent); }
.cc-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 12px/1 'Oswald', sans-serif; color: var(--dim); }
.cc-count.ok { color: #3ddc84; }
.cc-help { margin: 8px 2px 0; color: var(--dim); font-size: 12.5px; }
.cc-error { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px;
    background: rgba(255,59,59,.10); border: 1px solid rgba(255,59,59,.38); color: #ffd6d2; animation: cc-shake .4s ease; }
.cc-error .mud-icon-root { color: var(--red); font-size: 20px; flex: 0 0 auto; }

/* ── CTA ── */
.cc-cta-mini { display: none; }
.cc-cta { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 62px;
    border: 0; border-radius: 16px; cursor: pointer; font: 700 19px/1 'Oswald', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #140606;
    background: linear-gradient(135deg, #ff6a4a 0%, var(--red) 45%, var(--red-2) 100%);
    box-shadow: 0 16px 40px -12px rgba(255,59,59,.8), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.cc-cta .mud-icon-root { font-size: 24px; }
.cc-cta::before { content: ""; position: absolute; inset: 0 auto 0 -60%; width: 40%; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: cc-shine 3.2s ease-in-out infinite; }
.cc-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 22px 50px -12px rgba(255,59,59,.95), inset 0 1px 0 rgba(255,255,255,.35); }
.cc-cta:active:not(:disabled) { transform: translateY(1px) !important; box-shadow: 0 10px 30px -12px rgba(255,59,59,.8) !important; }
/* skarpskytten.css har en global button:active-regel – håll korten stabila vid tryck */
.cc-card:active:not(:disabled) { transform: translateY(-2px) scale(.985) !important; box-shadow: 0 0 0 2px var(--accent) !important; }
.cc-cta:disabled { cursor: not-allowed; filter: grayscale(.75) brightness(.55); box-shadow: none; }
.cc-cta:disabled::before { display: none; }
.cc-hint { margin: 10px 0 0; text-align: center; color: var(--dim); font-size: 12.5px; }
.cc-spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(20,6,6,.3); border-top-color: #140606; animation: cc-spin .8s linear infinite; }

/* ── Animationer ── */
@keyframes cc-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cc-reveal { from { opacity: 0; transform: scale(1.12); filter: blur(6px) brightness(.4); } to { opacity: 1; transform: scale(1.02); filter: none; } }
@keyframes cc-kenburns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
@keyframes cc-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cc-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }
@keyframes cc-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,59,.7); } 70% { box-shadow: 0 0 0 10px rgba(255,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); } }
@keyframes cc-shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes cc-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(3%, 2%, 0); } }
@keyframes cc-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ── Surfplatta ── */
@media (max-width: 1100px) {
    .cc-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "pick" "preview" "cta"; }
    .cc-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cc-portrait { grid-row: span 2; height: auto; min-height: 380px; }
    .cc-form { margin-top: 0; }
}

/* ── Mobil ── */
@media (max-width: 760px) {
    .cc { padding: 16px 14px 24px; }
    .cc-hero { margin: 4px auto 22px; }
    .cc-eyebrow { font-size: 10px; letter-spacing: .12em; }
    .cc-title { margin: 14px 0 10px; font-size: clamp(42px, 13vw, 58px); }
    .cc-lead { font-size: 14.5px; }
    .cc-grid { gap: 8px; }
    .cc-card { border-radius: 14px; }
    .cc-card.is-selected::after { border-radius: 15px; }
    .cc-card__body { left: 8px; right: 8px; bottom: 8px; }
    .cc-card__name { font-size: 14px; gap: 4px; letter-spacing: .03em; }
    .cc-card__emoji { font-size: 13px; }
    .cc-card__tag { display: none; }
    .cc-card__badge { top: 6px; left: 6px; padding: 3px 5px; font-size: 8.5px; }
    .cc-card__check { top: 6px; right: 6px; width: 22px; height: 22px; }
    .cc-card__check .mud-icon-root { font-size: 15px; }
    .cc-preview { display: block; border-radius: 18px; }
    .cc-portrait { height: 260px; min-height: 0; }
    .cc-info { padding: 16px 16px 0; }
    .cc-form { padding: 18px 16px 18px; }

    /* CTA-listen ligger fast längst ned (ovanför bottennavigeringen) så man alltid kan skapa direkt.
       (fixed i stället för sticky: body har overflow-x:hidden, vilket gör sticky verkningslöst) */
    .cc { padding-bottom: 150px; }
    .cc-cta-wrap { position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 20; padding: 10px;
        display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; border-radius: 18px;
        background: rgba(10,11,15,.92); backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: 0 -10px 40px -10px rgba(0,0,0,.8); }
    .cc-cta-mini { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 130px; }
    .cc-cta-mini img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; object-position: center 20%; border: 2px solid var(--accent); flex: 0 0 auto; }
    .cc-cta-mini span { display: flex; flex-direction: column; min-width: 0; }
    .cc-cta-mini b { font: 700 14px/1.1 'Oswald', sans-serif; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cc-cta-mini small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
    .cc-cta { min-height: 52px; font-size: 16px; letter-spacing: .1em; border-radius: 13px; }
    .cc-cta .mud-icon-root { font-size: 20px; }
    .cc-hint { grid-column: 1 / -1; margin: 0; font-size: 11.5px; }
}
@media (max-width: 360px) { .cc-cta-mini { display: none; } .cc-cta-wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    .cc *, .cc *::before, .cc *::after { animation: none !important; transition: none !important; }
}
