* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial;
  color: #f5f7fb;
  background: #0a0c12;
  margin: 0;
  padding: 20px 20px 80px;
}

.wrap {
  max-width: 980px;
  margin: 30px auto;
  background: #111318;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #2a2f3a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

h1 { margin: 0 0 10px; font-size: 26px; }

.note {
  font-size: 13px; color: #a9b0bd; margin-bottom: 18px;
  background: rgba(79, 140, 255, 0.08); padding: 8px 12px;
  border-radius: 10px; border: 1px dashed #2b3750;
}

.grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.dropzone {
  border: 2px dashed #2a2f3a; border-radius: 12px; padding: 28px 20px;
  text-align: center; cursor: pointer; background: #0f131b;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 140px; transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone:hover { border-color: #4f8cff; background: #101622; }
.dropzone h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.dropzone p { margin: 0; font-size: 13px; color: #a9b0bd; max-width: 90%; }
.dropzone input { display: none; }

.controls { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
select, input[type="number"] {
  background: #0e1219; color: #f5f7fb; border: 1px solid #2a2f3a;
  border-radius: 8px; padding: 6px 8px; outline: none; min-width: 120px;
}
select:focus, input[type="number"]:focus { border-color: #4f8cff; }

.btn {
  background: #4f8cff; color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn:hover { transform: translateY(-1px); background: #6ea2ff; }
.btn.success { background: #00c2a8; }
.btn.success:hover { background: #04d4b8; }
.btn.secondary { background: #1a2030; color: #cfd7e6; border: 1px solid #2a2f3a; }
.btn.secondary:hover { background: #232a3b; }
.btn.danger { background: #ff4d6d; }
.btn.danger:hover { background: #ff6b85; }

.preview {
  border: 1px solid #2a2f3a; border-radius: 12px; background: #0b0f16;
  display: flex; justify-content: center; align-items: center;
  min-height: 420px; overflow: hidden;
}
canvas { max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }

.hint { color: #a9b0bd; font-size: 12px; margin-top: 8px; }

.footer { position: sticky; bottom: 0; width: 100%; background: #0e1118; border-top: 1px solid #2a2f3a; }
.footer-inner { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.footer a { color: #9fb6ff; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* --- Oldalsó (lehúzható) panel --- */
.sidepanel {
  position: fixed;
  top: 0; right: 0;
  width: min(380px, 90vw);
  height: 100vh;
  background: #111318;
  border-left: 1px solid #2a2f3a;
  box-shadow: -10px 0 30px rgba(0,0,0,.35);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 60;
  display: flex; flex-direction: column;
}
.sidepanel.open { transform: translateX(0); }
.sidemask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 55;
}
.sidemask.open { opacity: 1; pointer-events: auto; }

.sidepanel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; border-bottom: 1px solid #2a2f3a;
}
.iconbtn { border: 1px solid #2a2f3a; background:#1a2030; color:#e5ecff; border-radius: 8px; padding:6px 10px; cursor:pointer; }

.sidepanel-section { padding: 14px; border-bottom: 1px solid #202533; }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.row.checkbox { grid-template-columns: auto 1fr; gap: 8px; }
output { font-variant-numeric: tabular-nums; color: #cfd7e6; }

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
  border: 1px solid #2a2f3a; background: #0e1219; color: #dfe7ff;
  border-radius: 999px; padding: 8px 10px; cursor: pointer; text-align: center;
}
.chip:hover { background: #1a1f2c; }

.sidepanel-footer { margin-top: auto; padding: 14px; display:flex; gap:10px; justify-content: flex-end; }

/* Kisebb kijelző finomhangolás */
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr auto; }
}


/* ===== Accessibility enhancements ===== */
:focus { outline: 3px solid rgba(79,140,255,0.75); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid rgba(79,140,255,0.9); outline-offset: 2px; }

.skip-link { position:absolute; left:-9999px; top:0; background:#4f8cff; color:#fff; padding:8px 12px; border-radius:8px; }
.skip-link:focus { left:10px; top:10px; z-index:1000; }

.a11y-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.a11y-toolbar .toggle { border:1px solid #2a2f3a; background:#1a2030; color:#e5ecff; border-radius:999px; padding:6px 10px; cursor:pointer; }
.a11y-toolbar .toggle[aria-pressed="true"] { background:#4f8cff; border-color:#4f8cff; color:#fff; }

body.a11y-dyslexia { font-family:"OpenDyslexic","Atkinson Hyperlegible",Verdana,Arial,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",sans-serif; letter-spacing:.0125em; word-spacing:.08em; line-height:1.6; }
body.a11y-large-text { font-size:18px; }
body.a11y-large-text h1 { font-size:30px; }
body.a11y-large-text h2 { font-size:22px; }
body.a11y-large-text .hint { font-size:14px; }
body.a11y-high-contrast { color:#fff; background:#000; }
body.a11y-high-contrast .wrap { background:#000; border-color:#555; }
body.a11y-high-contrast .note { background:#111; color:#fff; border-color:#666; }
body.a11y-high-contrast .dropzone { background:#000; border-color:#888; }
body.a11y-high-contrast .btn.secondary { background:#000; color:#fff; border-color:#888; }
body.a11y-high-contrast .footer { background:#000; border-top-color:#444; }
body.a11y-high-contrast .footer a { color:#9ec6ff; }
body.a11y-high-contrast .preview { background:#000; border-color:#666; }

@media (prefers-reduced-motion: reduce) { * { animation:none !important; transition:none !important; } }

.sidepanel-section h3 { margin:0 0 8px; font-size:16px; color:#e5ecff; }


/* Sidebars (tips + support/ads) */
.sidebar-box {
  position: fixed;
  top: 110px;
  width: 180px;
  z-index: 40;
}
.sidebar-left { left: 10px; }
.sidebar-right { right: 10px; }
.sidebar-card {
  background: #111318;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  font-size: 13px;
  color: #cfd7e6;
}
.sidebar-card h3 { margin: 0 0 8px; font-size: 15px; color: #e5ecff; }
.sidebar-card ul { margin: 0; padding-left: 18px; }
.sidebar-card li { margin: 6px 0; }
.sidebar-card .btn { width: 100%; text-align: center; }
.ad-placeholder {
  display:flex; align-items:center; justify-content:center;
  width: 160px; height: 600px;
  border: 1px dashed #2a2f3a; border-radius: 8px; background:#0e1219;
  color:#9fb6ff; text-align:center; padding:8px; margin-top:10px;
}

/* Only show sidebars on large viewports */
@media (max-width: 1199px) {
  .sidebar-box { display: none; }
}

/* Ensure wrap stays centered without overlap */
@media (min-width: 1200px) {
  .wrap { margin-left: auto; margin-right: auto; }
}


/* Sidebar CTA styling */
.sidebar-box { width: 220px; }
.sidebar-card.cta {
  background: linear-gradient(180deg, rgba(79,140,255,0.18), rgba(79,140,255,0.06));
  border-color: #3a4f80;
}
.sidebar-card.cta h3 {
  font-size: 16px; margin: 0 0 10px;
  display:flex; align-items:center; gap:8px;
}
.badge-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px;
  border-radius:999px; background:#4f8cff; color:#fff; font-weight:800;
  box-shadow: 0 2px 8px rgba(79,140,255,0.5);
}
.sidebar-card.cta ul { padding-left: 16px; }
.sidebar-card.cta li::marker { color:#9fb6ff; }
.sidebar-card .btn { width: 100%; box-sizing: border-box; white-space: normal; }
.sidebar-card .btn.secondary { background:#223056; border-color:#35519a; color:#dfe7ff; }
.sidebar-card .btn.secondary:hover { background:#2a3a68; }

/* Coffee card tightening */
#sidebarSupport .btn { width:100%; box-sizing:border-box; white-space:normal; }
#sidebarSupport .sidebar-card p { margin-top: 6px; margin-bottom: 10px; }
#sidebarSupport .ad-placeholder { width: 100%; height: 600px; }


/* === CTA button refinements === */
.sidebar-card .btn {
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-radius: 10px;
  padding: 8px 12px;
  transition: all 0.25s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Tippek (secondary) */
.sidebar-card .btn.secondary {
  background: linear-gradient(145deg, #1f2a48, #29395e);
  border: 1px solid #4f8cff;
  color: #dfe7ff;
}
.sidebar-card .btn.secondary:hover {
  background: linear-gradient(145deg, #3557a6, #2f4177);
  box-shadow: 0 0 12px rgba(79,140,255,0.35);
  transform: translateY(-1px);
}

/* Kávés (primary CTA) */
#sidebarSupport .btn {
  background: linear-gradient(145deg, #4f8cff, #2d63d1);
  border: 1px solid #2e5ed1;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
#sidebarSupport .btn:hover {
  background: linear-gradient(145deg, #6aa0ff, #3d70e2);
  box-shadow: 0 0 14px rgba(79,140,255,0.45);
  transform: translateY(-1px);
}


/* Guide page layout */
.guide { margin: 24px 0 40px; }
.guide-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: center; }
.guide figure { margin: 0; border: 1px solid #2a2f3a; border-radius: 12px; overflow: hidden; background:#0e1218; }
.guide img { display: block; width: 100%; height: auto; }
.guide figcaption { font-size: 14px; color:#9fb6ff; padding: 8px 10px; border-top:1px solid #2a2f3a; }
.guide ul { margin: 0; padding-left: 18px; }
.guide li { margin: 8px 0; }
@media (max-width: 900px) {
  .guide-grid { grid-template-columns: 1fr; }
}


/* screen reader only utility */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}



.wrap { backdrop-filter: blur(0px); }
