/* Skákakademían v1.2 — refined responsive layout, backgrounds and teaching editor */
html, body { max-width: 100%; overflow-x: hidden; }
.main-content, .workspace-page, .analysis-layout, .board-panel, .analysis-sidebar { min-width: 0; }
.board-shell { width: min(100%, 680px); max-width: min(100%, 68vh, 680px); }

@media (max-width: 1260px) and (min-width: 901px) {
  .top-status { display: none; }
  .profile-chip { margin-left: auto; }
  .analysis-layout { grid-template-columns: minmax(0, 1fr); }
  .analysis-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-sidebar .pgn-card { grid-column: 1 / -1; }
  .board-shell { max-width: min(100%, 720px); }
}

:root[data-skin="midnight"] { --custom-bg: radial-gradient(circle at 82% 4%, rgba(35,153,176,.12), transparent 35%), #07101d; }
:root[data-skin="aurora"] { --custom-bg: radial-gradient(circle at 12% 0%, rgba(86,220,204,.18), transparent 34%), radial-gradient(circle at 88% 12%, rgba(144,92,246,.23), transparent 38%), #090b20; --cyan: #6ae3d0; --cyan-2: #8af3df; }
:root[data-skin="ocean"] { --custom-bg: radial-gradient(circle at 78% 0%, rgba(36,126,232,.24), transparent 38%), linear-gradient(145deg, #061325, #071d31 55%, #04101e); --cyan: #4eb9ff; --cyan-2: #7bd0ff; }
:root[data-skin="forest"] { --custom-bg: radial-gradient(circle at 80% 0%, rgba(69,181,119,.19), transparent 38%), linear-gradient(145deg, #071610, #0c2119 55%, #06110d); --cyan: #66d99d; --cyan-2: #83edb7; }
:root[data-skin="royal"] { --custom-bg: radial-gradient(circle at 85% 8%, rgba(87,90,255,.28), transparent 36%), linear-gradient(145deg, #090b24, #12123b 58%, #08091d); --cyan: #8da2ff; --cyan-2: #b1bcff; }
:root[data-skin="ember"] { --custom-bg: radial-gradient(circle at 82% 2%, rgba(235,109,67,.22), transparent 38%), linear-gradient(145deg, #1a0b0d, #281014 55%, #10070a); --cyan: #ff9d6c; --cyan-2: #ffc08f; }
:root[data-skin] .command-center { background: var(--custom-bg); background-attachment: fixed; }
:root[data-skin="aurora"] .board-square.dark { background: #52658b; }
:root[data-skin="aurora"] .board-square.light { background: #d7e2e6; }
:root[data-skin="ocean"] .board-square.dark { background: #3e7191; }
:root[data-skin="ocean"] .board-square.light { background: #d7e4ec; }
:root[data-skin="forest"] .board-square.dark { background: #4f7b62; }
:root[data-skin="forest"] .board-square.light { background: #dbe5d6; }
:root[data-skin="royal"] .board-square.dark { background: #5d65a0; }
:root[data-skin="royal"] .board-square.light { background: #dcdff0; }
:root[data-skin="ember"] .board-square.dark { background: #92574d; }
:root[data-skin="ember"] .board-square.light { background: #ead8c9; }

.academy-tools-dock { position: fixed; z-index: 85; right: 18px; bottom: 18px; display: flex; gap: 9px; }
.academy-tool-button { min-height: 44px; padding: 0 14px; border: 1px solid rgba(137,173,207,.24); border-radius: 12px; color: #e9f4ff; background: rgba(8,19,32,.94); box-shadow: 0 10px 35px rgba(0,0,0,.35); backdrop-filter: blur(16px); display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; cursor: pointer; transition: .2s ease; }
.academy-tool-button:hover { transform: translateY(-2px); border-color: var(--cyan); }
.academy-tool-button span { color: var(--cyan-2); font-size: 19px; }

.academy-sheet { position: fixed; z-index: 100; right: 18px; bottom: 76px; width: min(330px, calc(100vw - 24px)); padding: 17px; border: 1px solid rgba(143,177,211,.22); border-radius: 16px; background: rgba(7,16,29,.97); box-shadow: 0 22px 80px rgba(0,0,0,.48); backdrop-filter: blur(20px); transform: translateY(12px); opacity: 0; pointer-events: none; transition: .2s ease; }
.academy-sheet.open { transform: none; opacity: 1; pointer-events: auto; }
.academy-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.academy-sheet-head strong { display: block; font-size: 14px; }.academy-sheet-head small { display: block; color: #8296ad; font-size: 9px; margin-top: 4px; }.academy-sheet-head button { border: 0; background: transparent; color: #8296ad; font-size: 20px; cursor: pointer; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.theme-choice { min-height: 64px; padding: 8px; border: 1px solid rgba(143,177,211,.14); border-radius: 10px; background: #0d1a2a; color: #d9e5f1; text-align: left; cursor: pointer; }
.theme-choice.active { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.theme-choice i { display: block; height: 25px; border-radius: 6px; margin-bottom: 7px; }.theme-choice span { font-size: 9px; font-weight: 800; }
.theme-choice[data-theme="midnight"] i { background: linear-gradient(135deg,#06111f,#1b4a5d); }.theme-choice[data-theme="aurora"] i { background: linear-gradient(135deg,#143f43,#582d86); }.theme-choice[data-theme="ocean"] i { background: linear-gradient(135deg,#09213c,#1979b7); }.theme-choice[data-theme="forest"] i { background: linear-gradient(135deg,#0a2217,#397c59); }.theme-choice[data-theme="royal"] i { background: linear-gradient(135deg,#11133d,#5c5eea); }.theme-choice[data-theme="ember"] i { background: linear-gradient(135deg,#2b0c10,#b84d36); }

.teaching-editor { position: fixed; z-index: 110; inset: 0; padding: 12px; background: rgba(2,7,13,.84); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.teaching-editor.open { opacity: 1; pointer-events: auto; }
.editor-window { width: min(1450px, 100%); height: min(920px, 100%); margin: auto; overflow: hidden; display: flex; flex-direction: column; border: 1px solid rgba(142,178,212,.21); border-radius: 18px; background: #081321; box-shadow: 0 30px 110px rgba(0,0,0,.55); }
.editor-header { min-height: 65px; padding: 10px 16px; border-bottom: 1px solid rgba(143,177,211,.14); display: flex; align-items: center; gap: 13px; }
.editor-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #031116; background: linear-gradient(135deg,var(--cyan-2),var(--cyan)); font-size: 26px; }.editor-title { flex: 1; }.editor-title strong { display: block; font-size: 14px; }.editor-title small { display: block; margin-top: 3px; color: #7e92aa; font-size: 9px; }
.editor-header-actions { display: flex; gap: 7px; }.editor-header-actions button, .editor-toolbar button, .editor-side button { min-height: 35px; padding: 0 11px; border: 1px solid rgba(143,177,211,.17); border-radius: 8px; color: #9db0c5; background: #101e2e; font-size: 9px; font-weight: 800; cursor: pointer; }.editor-header-actions button:hover, .editor-toolbar button:hover, .editor-side button:hover { color: #fff; border-color: var(--cyan); }.editor-header-actions .close-editor { min-width: 38px; padding: 0; color: #ff8c91; font-size: 18px; }
.editor-toolbar { padding: 9px 14px; border-bottom: 1px solid rgba(143,177,211,.12); display: flex; align-items: center; gap: 7px; overflow-x: auto; }.editor-toolbar .tool-button.active { color: #031116; background: var(--cyan-2); border-color: var(--cyan-2); }.editor-toolbar-divider { width: 1px; height: 26px; flex: 0 0 auto; background: rgba(143,177,211,.15); margin: 0 3px; }.arrow-color { width: 28px!important; min-width: 28px!important; height: 28px!important; min-height: 28px!important; padding: 0!important; border-radius: 50%!important; }.arrow-color.active { box-shadow: 0 0 0 2px #081321, 0 0 0 4px currentColor; }
.editor-stage { flex: 1; min-height: 0; padding: 14px; display: grid; grid-template-columns: minmax(440px, 1fr) minmax(270px, 340px); gap: 14px; overflow: auto; background: var(--custom-bg, #07101d); }
.editor-board-column { min-width: 0; display: flex; align-items: center; justify-content: center; }
.teaching-board-frame { position: relative; width: min(100%, 760px); aspect-ratio: 1; border-radius: 9px; overflow: hidden; box-shadow: 0 22px 65px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.12); }
.teaching-board { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8,1fr); }
.teach-square { position: relative; min-width: 0; padding: 0; border: 0; display: grid; place-items: center; cursor: pointer; }.teach-square.light { background: #d9e5e4; }.teach-square.dark { background: #4b7882; }.teach-square.selected { box-shadow: inset 0 0 0 5px rgba(246,184,79,.8); }.teach-square.marked::after { content: ""; position: absolute; inset: 8%; border-radius: 10%; background: var(--mark-color); opacity: .48; pointer-events: none; }.teach-square .piece-icon { position: relative; z-index: 2; width: 88%; height: 88%; filter: drop-shadow(0 3px 2px rgba(0,0,0,.28)); }.teach-square .coord { position: absolute; z-index: 4; left: 4px; top: 3px; color: rgba(4,25,33,.55); font-size: clamp(7px,1vw,11px); font-weight: 900; }.teach-square .coord.file { left: auto; top: auto; right: 4px; bottom: 2px; }
.teaching-arrows { position: absolute; z-index: 5; inset: 0; width: 100%; height: 100%; pointer-events: none; }.teaching-arrows line { stroke-linecap: round; opacity: .82; filter: drop-shadow(0 2px 1px rgba(0,0,0,.3)); }
.editor-side { min-width: 0; overflow-y: auto; display: grid; align-content: start; gap: 10px; }.editor-card { padding: 13px; border: 1px solid rgba(143,177,211,.15); border-radius: 12px; background: rgba(9,21,35,.94); }.editor-card h3 { margin: 0 0 10px; font-size: 11px; }.editor-card p { margin: 0 0 10px; color: #8195ad; font-size: 9px; line-height: 1.55; }
.piece-palette { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }.piece-palette button { min-width: 0; height: 39px; padding: 2px; }.piece-palette button.active { border-color: var(--cyan); background: rgba(36,209,220,.12); }.piece-palette svg { width: 100%; height: 100%; }.piece-palette .eraser { color: #ff8b91; font-size: 16px; }
.fen-row { display: flex; gap: 6px; }.fen-row input { flex: 1; min-width: 0; height: 36px; padding: 0 9px; border: 1px solid rgba(143,177,211,.17); border-radius: 8px; color: #dce8f4; background: #06101c; font-family: monospace; font-size: 9px; outline: none; }.fen-row button { flex: 0 0 auto; }
.editor-card textarea { width: 100%; min-height: 88px; resize: vertical; padding: 9px; border: 1px solid rgba(143,177,211,.17); border-radius: 8px; color: #dce8f4; background: #06101c; font-size: 10px; line-height: 1.5; outline: none; }.editor-hint { display: flex; gap: 8px; align-items: flex-start; padding: 9px; border-radius: 8px; color: #9bacc0; background: rgba(36,209,220,.06); font-size: 9px; line-height: 1.45; }.editor-hint strong { color: var(--cyan-2); }
.editor-toast { position: absolute; z-index: 9; left: 50%; bottom: 18px; transform: translate(-50%,12px); padding: 9px 13px; border-radius: 8px; color: #061219; background: var(--green); font-size: 9px; font-weight: 900; opacity: 0; transition: .2s; }.editor-toast.show { opacity: 1; transform: translate(-50%,0); }
.teaching-editor.presentation .editor-toolbar, .teaching-editor.presentation .editor-side { display: none; }.teaching-editor.presentation .editor-stage { grid-template-columns: 1fr; padding: 8px; }.teaching-editor.presentation .teaching-board-frame { width: min(88vh, 94vw); }.teaching-editor.presentation .editor-title small { color: var(--amber); }

@media (max-width: 900px) {
  .academy-tools-dock { right: 10px; bottom: 10px; }.academy-tool-button { width: 45px; padding: 0; justify-content: center; }.academy-tool-button b { display: none; }
  .academy-sheet { right: 10px; bottom: 64px; }
  .teaching-editor { padding: 0; }.editor-window { height: 100%; border-radius: 0; }.editor-stage { grid-template-columns: 1fr; }.editor-board-column { align-items: flex-start; }.editor-side { overflow: visible; }.editor-header-actions .action-label { display: none; }
}
@media (max-width: 600px) {
  .editor-header { min-height: 58px; padding: 8px; }.editor-logo { width: 34px; height: 34px; font-size: 22px; }.editor-title strong { font-size: 12px; }.editor-header-actions button { padding: 0 8px; }.editor-stage { padding: 7px; }.editor-toolbar { padding: 7px; }.editor-toolbar button { white-space: nowrap; }.piece-palette { grid-template-columns: repeat(7,1fr); }
}

/* v1.2 — comfortable type, height-aware board and calmer visual hierarchy */
.command-center {
  background-image:
    radial-gradient(circle at 78% 2%, rgba(36, 209, 220, .075), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, .012), transparent 42%);
}
.topbar {
  gap: 18px;
  background: rgba(4, 12, 22, .92);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
}
.top-status { font-size: 11px; }
.topbar > .academy-tools-dock {
  position: static;
  z-index: auto;
  flex: 0 0 auto;
  gap: 7px;
}
.topbar > .academy-tools-dock .academy-tool-button {
  min-height: 40px;
  padding: 0 11px;
  border-color: rgba(118, 172, 204, .19);
  background: linear-gradient(180deg, rgba(19, 37, 57, .92), rgba(10, 24, 39, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  font-size: 10px;
}
.topbar > .academy-tools-dock .academy-tool-button span { font-size: 17px; }
.academy-sheet {
  top: 82px;
  right: 18px;
  bottom: auto;
  border-color: rgba(92, 209, 218, .2);
  background: linear-gradient(155deg, rgba(12, 29, 45, .985), rgba(5, 14, 25, .985));
}

.sidebar {
  padding-inline: 15px;
  background: linear-gradient(180deg, rgba(7, 16, 28, .985), rgba(5, 13, 23, .985));
  box-shadow: inset -1px 0 rgba(255, 255, 255, .015);
}
.sidebar nav { gap: 7px; }
.sidebar nav button, .sidebar nav a {
  min-height: 62px;
  padding: 10px 11px;
  border-radius: 12px;
}
.sidebar nav strong { color: #aebed0; font-size: 14px; line-height: 1.25; }
.sidebar nav small { color: #72859d; margin-top: 4px; font-size: 10px; line-height: 1.3; }
.sidebar nav button:hover strong, .sidebar nav a:hover strong,
.sidebar nav button.active strong { color: #f1f7ff; }
.sidebar nav .nav-icon { font-size: 20px; }
.sidebar-engine {
  padding: 15px;
  border-color: rgba(115, 163, 197, .19);
  background: linear-gradient(150deg, rgba(15, 31, 49, .96), rgba(9, 22, 37, .96));
  box-shadow: 0 12px 35px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .025);
}
.sidebar-engine span strong { font-size: 13px; }
.sidebar-engine span small, .sidebar-engine > small { color: #7e91a8; font-size: 9.5px; line-height: 1.45; }
.sidebar-footer { color: #5d7088; font-size: 9.5px; }

.main-content { padding-top: 22px; }
.page-heading { min-height: 94px; }
.page-heading h1 { margin: 5px 0 4px; }
.page-heading p { color: #91b6d8; font-size: 12.5px; }
.local-badge {
  background: rgba(9, 24, 38, .72);
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}
.analysis-layout { gap: 18px; }
.board-panel, .analysis-sidebar > section {
  border-color: rgba(117, 163, 197, .18);
  background: linear-gradient(155deg, rgba(15, 31, 49, .91), rgba(8, 21, 35, .94));
  box-shadow: 0 18px 55px rgba(0, 0, 0, .17), inset 0 1px rgba(255, 255, 255, .026);
}
.board-panel { padding: 13px 14px 14px; }
.board-toolbar { margin-bottom: 10px; }
.board-toolbar button {
  min-height: 34px;
  border-color: rgba(124, 165, 200, .2);
  background: linear-gradient(180deg, #13243a, #0d1c2d);
  font-size: 10px;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.board-toolbar button:hover { color: #eefaff; border-color: rgba(36, 209, 220, .55); transform: translateY(-1px); }
.board-shell {
  width: min(100%, 660px);
  max-width: min(100%, 56dvh, 660px);
  border-radius: 9px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35), 0 0 0 1px rgba(212, 248, 255, .16), 0 0 42px rgba(36, 209, 220, .055);
}
.board-notice { color: #88a9c6; font-size: 10.5px; }

.analysis-sidebar { gap: 14px; }
.panel-title {
  min-height: 52px;
  padding-inline: 18px;
  font-size: 13.5px;
}
.panel-title em { font-size: 9.5px; }
.panel-title button { font-size: 10.5px; }
.best-move {
  margin: 0 16px 16px;
  padding: 16px;
  border-color: rgba(115, 163, 197, .18);
  background: linear-gradient(145deg, rgba(6, 19, 32, .95), rgba(9, 28, 43, .92));
}
.best-move span { font-size: 9.5px; }
.best-move small { color: #9ab0c7; font-size: 10.5px; line-height: 1.6; }
.coach-card { padding: 18px; }
.coach-head strong { font-size: 14px; }
.coach-head small { font-size: 9.5px; }
.coach-card > p { color: #b8c8d9; font-size: 11.5px; line-height: 1.7; }
.coach-prompt { color: #aebed0; font-size: 10.5px; line-height: 1.45; }
.coach-prompt span { width: 22px; height: 22px; flex: 0 0 auto; font-size: 9px; }
.pgn-card textarea, .setup-card textarea { font-size: 10.5px; line-height: 1.55; }
.pgn-card button { font-size: 10px; }

@media (max-width: 1450px) and (min-width: 901px) {
  .topbar > .academy-tools-dock .academy-tool-button { width: 40px; padding: 0; justify-content: center; }
  .topbar > .academy-tools-dock .academy-tool-button b { display: none; }
}
@media (max-width: 1260px) and (min-width: 901px) {
  .topbar > .academy-tools-dock { margin-left: auto; }
  .profile-chip { margin-left: 0; }
  .board-shell { width: min(100%, 640px); max-width: min(100%, 60dvh, 640px); }
}
@media (max-width: 900px) {
  .topbar > .academy-tools-dock { margin-left: auto; right: auto; bottom: auto; }
  .topbar > .academy-tools-dock .academy-tool-button { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .topbar > .academy-tools-dock .academy-tool-button b { display: none; }
  .profile-chip { margin-left: 0; }
  .academy-sheet { top: 76px; right: 10px; bottom: auto; }
  .board-shell { width: min(100%, 640px); max-width: min(100%, 66dvh, 640px); }
}
@media (max-width: 650px) {
  .topbar { gap: 6px; }
  .topbar > .academy-tools-dock { gap: 4px; }
  .topbar > .academy-tools-dock .academy-tool-button { width: 36px; min-height: 36px; border-radius: 10px; }
  .topbar > .academy-tools-dock .academy-tool-button span { font-size: 16px; }
  .academy-sheet { top: 70px; }
  .page-heading { min-height: 0; }
  .board-shell { max-width: min(100%, 72dvh); }
}
