/* =========================================================
   Spyware simulation – styles
   Sizes use "rem" so that Board Mode (big screen) can scale
   everything just by changing the root font size.
   1rem = 18px in normal mode.
   ========================================================= */

:root {
  --bg: #fff7e6;
  --ink: #2b2250;
  --purple: #6c4cf1;
  --pink: #ff5c8a;
  --yellow: #ffc933;
  --mint: #2ec4a6;
  --dark: #1b1535;
}

html {
  font-size: 18px;
}

/* Board mode: the whole page grows with the screen width */
html.board-mode {
  font-size: clamp(20px, 1.5vw, 30px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Baloo 2", "Trebuchet MS", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
}


/* ---------- Header and tabs ---------- */

.top {
  text-align: center;
  padding: 1rem 0.7rem 0;
}

.top h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--purple);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  padding: 0.8rem;
}

.tab {
  font: inherit;
  font-weight: 600;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}

.tab.active {
  background: var(--yellow);
}

.board-btn {
  background: var(--mint);
  color: #fff;
}

.tab:focus-visible,
.btn:focus-visible,
input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
}

main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 0.8rem 2rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.hint {
  background: #e9fff8;
  border: 2px dashed var(--mint);
  padding: 0.4rem 0.8rem;
  border-radius: 14px;
}


/* ---------- Tab 1: the fake computer screen ---------- */

.screen {
  position: relative;
  height: 25.5rem;
  border: 6px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #7fd8ff, #b79bff 60%, #ffb3d1);
  box-shadow: 0 8px 0 var(--ink);
  user-select: none;
}

.desktop-icons {
  position: absolute;
  left: 0.8rem;
  top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.icon {
  font: inherit;
  font-size: 2rem;
  width: 4.7rem;
  padding: 0.2rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  cursor: pointer;
}

.icon span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Windows inside the fake screen */
.win {
  position: absolute;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
  user-select: text;
}

.win[hidden] {
  display: none;
}

.win-bar {
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
}

.win-body {
  padding: 0.6rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.win.login {
  left: 7.2rem;
  top: 1.7rem;
  width: 16.7rem;
}

.win.chat {
  right: 1.1rem;
  top: 3.9rem;
  width: 16.7rem;
}

.win.console {
  left: 7.2rem;
  top: 1.1rem;
  width: 16.7rem;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}

input {
  font: inherit;
  padding: 0.3rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.btn {
  font: inherit;
  font-weight: 600;
  background: var(--pink);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 0.3rem 0.8rem;
  margin-top: 0.3rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.btn.small {
  padding: 0.15rem 0.7rem;
}

.msg {
  margin: 0.2rem 0 0;
  min-height: 1.4em;
  font-weight: 600;
  color: var(--mint);
}

.chat-box {
  height: 7.2rem;
  overflow-y: auto;
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  background: #f3efff;
  font-size: 0.9rem;
}

.chat-box p {
  margin: 2px 0;
}

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0.9rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}


/* ---------- Game console (shown after login) ---------- */

.device {
  background: #3b2f7a;
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 0.6rem;
}

.lcd {
  position: relative;
  height: 8.3rem;
  border: 4px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(#8fe3ff, #d9f6ff);
}

.sun {
  position: absolute;
  right: 0.8rem;
  top: 0.6rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--yellow);
}

.cloud {
  position: absolute;
  font-size: 1.6rem;
  animation: drift 9s linear infinite;
}

.cloud.c1 {
  top: 0.4rem;
  left: 100%;
}

.cloud.c2 {
  top: 1.9rem;
  left: 100%;
  animation-delay: -4.5s;
  animation-duration: 12s;
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.55rem;
  background: repeating-linear-gradient(90deg, #3ec46d 0 1.1rem, #2fa85a 1.1rem 2.2rem);
  animation: scroll-ground 0.8s linear infinite;
}

.hero {
  position: absolute;
  left: 1.7rem;
  bottom: 1.45rem;
  font-size: 2rem;
  animation: jump 1.6s ease-in-out infinite;
}

.coin {
  position: absolute;
  left: 100%;
  bottom: 1.8rem;
  font-size: 1.3rem;
  animation: coin-move 3.2s linear infinite;
}

.coin.k2 {
  bottom: 3.9rem;
  animation-delay: -1.1s;
}

.coin.k3 {
  animation-delay: -2.2s;
}

.lcd-text {
  position: absolute;
  left: 0.5rem;
  top: 0.3rem;
  font-weight: 800;
  color: var(--ink);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem 0.1rem;
}

.dpad {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: var(--dark);
  clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%,
                     65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%);
}

.ab {
  display: flex;
  gap: 0.6rem;
}

.ab i {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--pink);
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.ab i + i {
  margin-top: -0.7rem;
  background: var(--yellow);
  color: var(--ink);
}

@keyframes drift {
  to { transform: translateX(-21rem); }
}

@keyframes scroll-ground {
  to { background-position-x: -2.2rem; }
}

@keyframes jump {
  0%, 55%, 100% { transform: translateY(0); }
  70%           { transform: translateY(-2.7rem) rotate(-10deg); }
  85%           { transform: translateY(-2.7rem) rotate(10deg); }
}

@keyframes coin-move {
  to { transform: translateX(-19rem); }
}


/* ---------- Tab 2: the attacker's screen ---------- */

.attacker {
  background: var(--dark);
  color: #d9fff1;
  border: 6px solid #000;
  border-radius: 18px;
  padding: 0.8rem;
  box-shadow: 0 8px 0 #000;
}

.a-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.live {
  color: #ff5c5c;
  font-weight: 800;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  50% { opacity: 0.45; }
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0.7rem 0;
}

.stat {
  flex: 1;
  min-width: 7rem;
  padding: 0.5rem;
  border-radius: 14px;
  background: #2a2150;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 1.8rem;
  color: var(--yellow);
  word-break: break-all;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.card {
  margin-bottom: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  background: #2a2150;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--yellow);
}

/* Click map: a grid with a red dot for every click */
.map {
  position: relative;
  height: 12.8rem;
  border-radius: 10px;
  overflow: hidden;
  background-color: #14102b;
  background-image:
    linear-gradient(#2d2459 1px, transparent 1px),
    linear-gradient(90deg, #2d2459 1px, transparent 1px);
  background-size: 10% 10%;
}

.dot {
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #ff5c5c;
  transform: translate(-50%, -50%);
}

.dot.new {
  animation: pop 0.6s;
}

@keyframes pop {
  from { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.typed {
  min-height: 12.8rem;
  max-height: 12.8rem;
  overflow-y: auto;
}

.typed .field {
  margin-bottom: 0.5rem;
}

.typed .field b {
  color: var(--mint);
}

.typed code {
  display: block;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  background: #14102b;
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  word-break: break-all;
}

.typed .secret code {
  border: 2px solid #ff5c5c;
  color: #ff8a8a;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 12rem;
  overflow-y: auto;
  font-size: 0.95rem;
}

.log li {
  padding: 2px 0;
  border-bottom: 1px solid #3a306b;
}

.log time {
  margin-right: 0.5rem;
  color: var(--mint);
}

.empty {
  color: #9d93c9;
  font-style: normal;
}


/* ---------- Tab 3: protection tips ---------- */

.big {
  text-align: center;
  font-size: 1.8rem;
  color: var(--purple);
}

.tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.8rem;
}

.tip {
  padding: 0.7rem 1rem;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 0 var(--ink);
}

.tip span {
  font-size: 2.2rem;
}

.tip h3 {
  margin: 0;
  color: var(--pink);
}

.tip p {
  margin: 0.2rem 0 0;
}


/* ---------- Small screens and accessibility ---------- */

@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .win.chat {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live,
  .dot.new,
  .cloud,
  .ground,
  .hero,
  .coin {
    animation: none;
  }
}