/* Quiz.exe — styles */

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

:root {
  --gray:        #c0c0c0;
  --gray-dark:   #808080;
  --gray-darker: #404040;
  --white:       #ffffff;
  --black:       #000000;
  --navy:        #000080;
  --navy-light:  #1084d0;
  --teal:        #008080;
  --font:        'Tahoma', 'MS Sans Serif', Arial, sans-serif;
}

body {
  font-family: var(--font);
  font-size: 12px;
  background: var(--teal);
  overflow: hidden;
  height: 100dvh;
  color: var(--black);
}

/* ---------- Desktop ---------- */
.desktop {
  position: relative;
  width: 100vw;
  height: 100dvh;
  background: var(--teal);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-icons {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 6px 4px;
  cursor: default;
  border: 1px solid transparent;
  outline: none;
}

.icon:hover,
.icon:focus {
  background: rgba(0, 0, 128, 0.35);
  border: 1px dotted var(--white);
}

.icon-img { font-size: 30px; }

.icon-label {
  margin-top: 5px;
  color: var(--white);
  font-size: 11px;
  text-align: center;
  text-shadow: 1px 1px 1px var(--black);
  line-height: 1.3;
}

/* ---------- Window ---------- */
.window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 15px));
  background: var(--gray);
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  width: 600px;
  max-width: calc(100vw - 10px);
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  z-index: 10;
  user-select: none;
}

/* ---------- Title Bar ---------- */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, var(--navy), var(--navy-light));
  padding: 3px 4px;
  cursor: move;
  flex-shrink: 0;
}

.title-bar-text {
  color: var(--white);
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-bar-controls { display: flex; gap: 2px; flex-shrink: 0; margin-left: 6px; }

.title-btn {
  width: 18px;
  height: 16px;
  background: var(--gray);
  border-top:    1px solid var(--white);
  border-left:   1px solid var(--white);
  border-right:  1px solid var(--gray-darker);
  border-bottom: 1px solid var(--gray-darker);
  font-family: var(--font);
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.title-btn:active {
  border-top:    1px solid var(--gray-darker);
  border-left:   1px solid var(--gray-darker);
  border-right:  1px solid var(--white);
  border-bottom: 1px solid var(--white);
}

/* ---------- Menu Bar ---------- */
.menu-bar {
  display: flex;
  padding: 2px 4px 1px;
  border-bottom: 1px solid var(--gray-dark);
  flex-shrink: 0;
  background: var(--gray);
}

.menu-item { padding: 2px 10px; cursor: default; font-size: 12px; }
.menu-item:hover { background: var(--navy); color: var(--white); }

/* ---------- Window Body ---------- */
.window-body { flex: 1; overflow: hidden; position: relative; min-height: 0; }

/* ---------- Status Bar ---------- */
.status-bar {
  display: flex;
  border-top: 1px solid var(--gray-dark);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
  background: var(--gray);
}

.status-panel {
  border-top:    1px solid var(--gray-darker);
  border-left:   1px solid var(--gray-darker);
  border-right:  1px solid var(--white);
  border-bottom: 1px solid var(--white);
  padding: 2px 8px;
  font-size: 11px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-clock { flex: 0 0 auto; }

/* ---------- Taskbar ---------- */
.taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  background: var(--gray);
  border-top: 2px solid var(--white);
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  z-index: 100;
}

.taskbar-start {
  background: var(--gray);
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  padding: 2px 8px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--black);
}

.taskbar-start:active,
.taskbar-start.is-active {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
}

.start-logo { font-size: 14px; }

.taskbar-sep {
  width: 0;
  height: 22px;
  border-left:  1px solid var(--gray-dark);
  border-right: 1px solid var(--white);
  margin: 0 2px;
}

.taskbar-tasks { flex: 1; display: flex; align-items: center; gap: 2px; overflow: hidden; }

.taskbar-task {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  cursor: default;
}

.taskbar-task.is-active {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  background: repeating-linear-gradient(45deg, var(--gray) 0px, var(--gray) 1px, #d0d0d0 1px, #d0d0d0 2px);
  padding-left: 11px;
  padding-top: 1px;
}

.taskbar-tray {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ---------- Scrollbar (Webkit) ---------- */
::-webkit-scrollbar { width: 16px; }
::-webkit-scrollbar-track { background: var(--gray); border-top: 1px solid var(--gray-darker); border-left: 1px solid var(--gray-darker); }
::-webkit-scrollbar-thumb { background: var(--gray); border-top: 2px solid var(--white); border-left: 2px solid var(--white); border-right: 2px solid var(--gray-darker); border-bottom: 2px solid var(--gray-darker); }
::-webkit-scrollbar-button { background: var(--gray); border-top: 2px solid var(--white); border-left: 2px solid var(--white); border-right: 2px solid var(--gray-darker); border-bottom: 2px solid var(--gray-darker); display: block; height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .window { width: 100vw; max-width: 100vw; max-height: calc(100dvh - 32px); top: 0; left: 0; transform: none; border-left: none; border-right: none; border-top: none; }
  .desktop-icons { display: none; }
  .title-bar { cursor: default; }
  /* hover-submenus don't work on touch, so hide them */
  .has-sub .entry-arrow { display: none; }
  .has-sub:hover .submenu { display: none; }
}

@media (max-height: 520px) {
  .screen-content { padding: 14px; }
  .splash-icon { font-size: 36px; }
}

/* ---------- Screens ---------- */
.screen { display: none; height: 100%; overflow-y: auto; }
.screen.active { display: block; }

.screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px;
  min-height: 100%;
}

.splash-icon { font-size: 52px; margin-bottom: 10px; }
.app-title { font-size: 22px; font-weight: bold; margin-bottom: 4px; }
.app-version { color: var(--gray-dark); font-size: 11px; margin-bottom: 14px; }

.separator {
  width: 80%;
  border: none;
  border-top: 1px solid var(--gray-dark);
  border-bottom: 1px solid var(--white);
  margin: 0 auto 16px;
}

.intro-text { color: var(--gray-darker); line-height: 1.7; margin-bottom: 22px; font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--gray);
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  padding: 5px 18px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  color: var(--black);
  min-width: 90px;
  text-align: center;
  line-height: 1.4;
}

.btn:hover:not(:disabled) { background: #d0d0d0; }

.btn:active:not(:disabled) {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  padding-top: 6px;
  padding-left: 19px;
}

.btn:disabled { color: var(--gray-dark); cursor: default; text-shadow: 1px 1px 0 var(--white); }
.btn-primary { outline: 2px dotted var(--black); outline-offset: -5px; }
.btn-sm { padding: 3px 10px; min-width: 0; font-size: 11px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Quiz Layout ---------- */
.quiz-layout { display: flex; flex-direction: column; gap: 10px; padding: 14px; height: 100%; }
#quiz-screen.active { display: block; }

.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-label { font-size: 11px; color: var(--gray-darker); white-space: nowrap; min-width: 110px; }

.progress-track {
  flex: 1;
  height: 18px;
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  background: var(--gray-dark);
  overflow: hidden;
}

.progress-fill { height: 100%; background: var(--navy); width: 0; transition: width 0.35s ease; }

.question-panel {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  background: var(--white);
  padding: 14px 16px;
  min-height: 72px;
  display: flex;
  align-items: center;
}

.question-text { font-size: 13px; line-height: 1.6; }

.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.answer-btn {
  background: var(--gray);
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  min-height: 48px;
  color: var(--black);
}

.answer-btn:hover:not(:disabled) { background: #d8d8d8; }

.answer-btn:active:not(:disabled) {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  padding-top: 11px;
  padding-left: 13px;
}

.answer-btn:disabled { cursor: default; }
.answer-btn.is-correct { background: #006600; color: var(--white); border-color: #004400 #009900 #009900 #004400; }
.answer-btn.is-wrong   { background: #880000; color: var(--white); border-color: #550000 #cc0000 #cc0000 #550000; }
.answer-btn.is-missed  { background: #000077; color: var(--white); border-color: #000044 #0000bb #0000bb #000044; }

.quiz-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.score-tracker { font-size: 12px; font-weight: bold; }

/* ---------- Results ---------- */
.result-icon { font-size: 56px; margin-bottom: 10px; animation: pop-in 0.3s ease; }

@keyframes pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.results-title { font-size: 18px; font-weight: bold; margin-bottom: 14px; }

.score-box {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  background: var(--white);
  padding: 14px 50px;
  margin-bottom: 12px;
  text-align: center;
}

.score-number { font-size: 32px; font-weight: bold; }
.score-percent { font-size: 15px; color: var(--gray-darker); margin-top: 2px; }
.score-message { font-size: 12px; line-height: 1.6; max-width: 360px; color: var(--gray-darker); }

/* ---------- Review ---------- */
#review-screen.active { display: flex; flex-direction: column; }
.review-layout { display: flex; flex-direction: column; height: 100%; }

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-dark);
  flex-shrink: 0;
}

.review-title { font-weight: bold; font-size: 13px; }

.review-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }

.review-item {
  border-top:    2px solid var(--gray-darker);
  border-left:   2px solid var(--gray-darker);
  border-right:  2px solid var(--white);
  border-bottom: 2px solid var(--white);
  background: var(--white);
  padding: 10px 12px;
}

.review-q { font-weight: bold; font-size: 12px; margin-bottom: 8px; line-height: 1.4; }
.review-a { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.5; }
.review-tag { padding: 1px 5px; font-weight: bold; flex-shrink: 0; font-size: 11px; }
.review-tag.ok  { background: #009900; color: var(--white); }
.review-tag.err { background: #880000; color: var(--white); }
.correct-text { color: #005500; font-weight: bold; }

@media (max-width: 620px) {
  .answers-grid { grid-template-columns: 1fr; }
  .score-box { padding: 12px 20px; }
}

/* ---------- Start Menu ---------- */
.start-menu {
  position: fixed;
  bottom: 32px;
  left: 0;
  display: flex;
  flex-direction: row;
  background: var(--gray);
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.start-menu.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }

.start-sidebar {
  width: 26px;
  background: linear-gradient(to top, var(--navy), #1a6bb5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  flex-shrink: 0;
  user-select: none;
}

.start-sidebar-text {
  color: rgba(255,255,255,0.25);
  font-size: 16px;
  font-weight: bold;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 2px;
  white-space: nowrap;
}

.start-menu-items { display: flex; flex-direction: column; min-width: 190px; padding: 2px; }

.menu-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 6px;
  cursor: default;
  position: relative;
  white-space: nowrap;
  font-size: 12px;
}

.menu-entry:hover { background: var(--navy); color: var(--white); }
.entry-icon  { font-size: 16px; flex-shrink: 0; }
.entry-label { flex: 1; }
.entry-arrow { font-size: 9px; margin-left: auto; }

.menu-separator { height: 0; border-top: 1px solid var(--gray-dark); border-bottom: 1px solid var(--white); margin: 3px 4px; }

.submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -2px;
  background: var(--gray);
  border-top:    2px solid var(--white);
  border-left:   2px solid var(--white);
  border-right:  2px solid var(--gray-darker);
  border-bottom: 2px solid var(--gray-darker);
  min-width: 170px;
  z-index: 210;
  padding: 2px;
}

.has-sub:hover .submenu { display: flex; flex-direction: column; }
.submenu .menu-entry:hover { background: var(--navy); color: var(--white); }
