:root {
  --ink: #111;
  --line: #9b9b9b;
  --dark-line: #575757;
  --paper: #f7f7f3;
  --screen: #eceeed;
  --bar: #708494;
  --blue: #87a9ef;
  --pink: #eda4df;
  --red: #c82418;
  --shadow: #cfcfcf;
  --disabled: #b7b7b7;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, transparent 0 48px, #bcbcbc 48px 51px),
    repeating-linear-gradient(0deg, transparent 0 48px, #bcbcbc 48px 51px),
    #f0f1ef;
  font-family: "MS Gothic", "Fixedsys", "Courier New", monospace;
  image-rendering: pixelated;
}

a {
  color: inherit;
}

.handheld {
  width: min(768px, calc(100vw - 16px));
  min-height: 1024px;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0 2px, rgba(210, 210, 210, 0.6) 2px 4px),
    repeating-linear-gradient(90deg, transparent 0 48px, #bcbcbc 48px 51px),
    repeating-linear-gradient(0deg, transparent 0 48px, #bcbcbc 48px 51px),
    var(--screen);
  position: relative;
  overflow: hidden;
}

.status-bar {
  height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto auto 44px 44px 54px;
  align-items: center;
  gap: 0;
  padding: 0 7px;
  color: white;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.12) 0 1px, transparent 1px 4px),
    var(--bar);
  border-bottom: 2px solid var(--ink);
  font-size: 28px;
  line-height: 1;
}

.status-spacer,
#menu-time,
#menu-date,
.status-icon,
.battery {
  border-left: 2px dotted #3d4a52;
}

#menu-time,
#menu-date,
.status-icon,
.battery {
  height: 100%;
  display: grid;
  place-items: center;
  padding-inline: 9px;
}

.status-user {
  min-width: 48px;
}

.status-icon {
  position: relative;
  text-transform: uppercase;
  color: var(--ink);
  font-size: 24px;
  background: rgba(255,255,255,.08);
}

.card-icon::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid var(--ink);
  background:
    linear-gradient(#f06b32 0 8px, transparent 8px),
    #d9d9d9;
  box-shadow: inset 0 0 0 3px #747474;
}

.mode-icon {
  color: #fff;
  text-shadow: 2px 0 #111, -2px 0 #111, 0 2px #111, 0 -2px #111;
}

.battery span {
  width: 36px;
  height: 18px;
  display: block;
  border: 3px solid var(--ink);
  background: linear-gradient(90deg, #50d85d 0 78%, transparent 78%);
  position: relative;
}

.battery span::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 4px;
  width: 5px;
  height: 8px;
  background: var(--ink);
}

.top-widgets {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  padding: 52px 50px 138px;
}

.clock-face,
.calendar-widget {
  border: 3px solid var(--ink);
  background: rgba(255,255,255,.54);
  box-shadow: inset 3px 3px #fff, inset -3px -3px var(--shadow);
}

.clock-face {
  aspect-ratio: 1;
  position: relative;
}

.num {
  position: absolute;
  color: #9b9b9b;
  font-size: 56px;
  font-weight: 700;
}

.n12 { top: 10px; left: 50%; transform: translateX(-50%); }
.n3 { right: 26px; top: 50%; transform: translateY(-50%); }
.n6 { bottom: 8px; left: 50%; transform: translateX(-50%); }
.n9 { left: 24px; top: 50%; transform: translateY(-50%); }

.tick {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #8a8a8a;
}

.t1 { left: 70%; top: 14%; }
.t2 { left: 84%; top: 34%; }
.t4 { left: 84%; top: 64%; }
.t5 { left: 70%; top: 84%; }
.t7 { left: 28%; top: 84%; }
.t8 { left: 12%; top: 64%; }
.t10 { left: 12%; top: 34%; }
.t11 { left: 28%; top: 14%; }

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: 50% 100%;
  background: #555;
}

.hour-hand {
  width: 7px;
  height: 78px;
}

.minute-hand {
  width: 5px;
  height: 110px;
  background: #5d7b8e;
}

.second-hand {
  width: 3px;
  height: 124px;
  background: #e34b57;
}

.pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: #555;
}

.calendar-widget {
  align-self: start;
}

.calendar-widget h2 {
  margin: 0;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: rgba(255,255,255,.7);
  border-bottom: 3px solid var(--ink);
  letter-spacing: 3px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-grid span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: #f9f9f6;
  font-size: 31px;
}

.calendar-grid .day-name {
  min-height: 48px;
  color: #fff;
  background: #4b4b4b;
  font-size: 25px;
}

.calendar-grid .sun,
.calendar-grid .sun-name {
  background: var(--pink);
  color: #7c1129;
}

.calendar-grid .sat,
.calendar-grid .sat-name {
  background: var(--blue);
  color: #0e348f;
}

.calendar-grid .today {
  outline: 3px dotted var(--dark-line);
  outline-offset: -7px;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.08) 2px 4px),
    #e9f0f0;
}

.menu-grid {
  width: min(620px, calc(100% - 90px));
  margin: 0 auto 34px;
  display: grid;
  gap: 8px;
}

.menu-tile {
  position: relative;
  display: grid;
  color: var(--ink);
  text-decoration: none;
  border: 3px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.72) 0 2px, rgba(210,210,210,.48) 2px 4px),
    #f8f8f6;
  box-shadow: inset 4px 4px #fff, inset -4px -4px var(--shadow);
}

.menu-tile:hover,
.menu-tile:focus-visible {
  outline: 0;
  box-shadow:
    inset 4px 4px #fff,
    inset -4px -4px var(--shadow),
    0 0 0 4px #5c788f,
    0 0 0 7px #eef7ff;
  z-index: 2;
}

.cartridge {
  min-height: 132px;
  grid-template-columns: 128px 1fr;
  align-items: center;
  padding: 18px;
}

.corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #5c788f;
}

.c1 { left: -7px; top: -7px; border-left: 7px solid; border-top: 7px solid; }
.c2 { right: -7px; top: -7px; border-right: 7px solid; border-top: 7px solid; }
.c3 { left: -7px; bottom: -7px; border-left: 7px solid; border-bottom: 7px solid; }
.c4 { right: -7px; bottom: -7px; border-right: 7px solid; border-bottom: 7px solid; }

.cart-art {
  width: 98px;
  height: 98px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 7px;
  border: 3px solid #a03060;
  background: #f3aacd;
}

.cart-art span {
  border: 3px solid var(--ink);
  background:
    radial-gradient(circle at 46% 42%, #111 0 7px, transparent 8px),
    radial-gradient(circle at 66% 42%, #111 0 5px, transparent 6px),
    #ff8cc9;
}

.cart-art span + span {
  background:
    radial-gradient(circle at 42% 42%, #111 0 6px, transparent 7px),
    radial-gradient(circle at 62% 42%, #111 0 5px, transparent 6px),
    #ff965f;
}

.tile-text {
  text-align: center;
  font-size: 31px;
  line-height: 1.12;
}

.tile-text strong,
.tile-text small {
  display: block;
  font-weight: 400;
}

.tile-text small {
  font-size: 24px;
}

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

.app-tile {
  min-height: 132px;
  padding: 24px;
  align-content: center;
  overflow: hidden;
}

.tile-title {
  font-size: 31px;
}

.tiny-card,
.talk-lines,
.dock-card {
  position: absolute;
  right: 8px;
  bottom: -5px;
  width: 52px;
  height: 42px;
  border: 3px solid var(--ink);
  background: #e7e7e5;
  box-shadow: inset 0 0 0 5px #fff;
}

.talk-lines i {
  display: block;
  height: 5px;
  margin: 6px 7px;
  background: var(--ink);
}

.disabled-tile {
  min-height: 128px;
  grid-template-columns: 135px 1fr;
  align-items: center;
  padding: 20px 28px;
  color: var(--disabled);
  border-color: #d6d6d6;
  box-shadow: inset 3px 3px #fff;
}

.disabled-icon {
  width: 74px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 5px solid #c9c9c9;
  color: #c1c1c1;
  font-size: 22px;
  text-transform: uppercase;
  background: #eee;
}

.disabled-tile span:last-child {
  font-size: 31px;
  text-align: center;
}

.bottom-dock {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 16px;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.sun,
.gear {
  width: 28px;
  height: 28px;
}

.sun {
  background:
    radial-gradient(circle, #e4a828 0 5px, transparent 6px),
    conic-gradient(from 0deg, #e4a828 0 8%, transparent 8% 17%, #e4a828 17% 25%, transparent 25% 34%, #e4a828 34% 42%, transparent 42% 51%, #e4a828 51% 59%, transparent 59% 68%, #e4a828 68% 76%, transparent 76% 85%, #e4a828 85% 93%, transparent 93%);
}

.gear {
  justify-self: end;
  border: 5px dotted #707070;
  border-radius: 50%;
}

.dock-card {
  position: static;
  display: block;
}

.page-shell {
  width: min(768px, calc(100vw - 16px));
  min-height: 720px;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0 2px, rgba(210, 210, 210, 0.6) 2px 4px),
    repeating-linear-gradient(90deg, transparent 0 48px, #bcbcbc 48px 51px),
    #f0f1ef;
}

.page-main {
  width: min(620px, calc(100% - 32px));
  margin: 36px auto;
  padding: 20px;
  border: 3px solid var(--ink);
  background: #f8f8f6;
  box-shadow: inset 4px 4px #fff, inset -4px -4px var(--shadow);
}

.page-main h1 {
  margin: 0 0 18px;
  font-size: 32px;
}

.page-main p,
.archive-list a {
  font-size: 20px;
  line-height: 1.35;
}

.archive-list {
  display: grid;
  gap: 10px;
}

.archive-list a {
  padding: 10px;
  border: 2px solid var(--ink);
  background: white;
  text-decoration: none;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 18px;
}

@media (max-width: 700px) {
  body {
    display: block;
  }

  .handheld,
  .page-shell {
    width: 100%;
    min-height: 100vh;
    border-inline: 0;
  }

  .status-bar {
    grid-template-columns: auto 1fr auto auto 32px 32px 42px;
    font-size: 18px;
  }

  .top-widgets {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 20px 58px;
  }

  .clock-face {
    max-width: 260px;
    margin: auto;
  }

  .menu-grid {
    width: calc(100% - 26px);
  }

  .cartridge,
  .small-row,
  .disabled-tile {
    grid-template-columns: 1fr;
  }

  .tile-text,
  .tile-title,
  .disabled-tile span:last-child {
    font-size: 24px;
  }
}
