:root {
  --ink: #171717;
  --muted: #5f6368;
  --paper: #f3efe7;
  --panel: #fffaf0;
  --line: #252525;
  --acid: #67e8a5;
  --sol-green: #14f195;
  --hot: #ff4d6d;
  --coin: #f7c948;
  --blue: #00c2ff;
  --violet: #9945ff;
  --gray: #d8d8d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
}

.gate-card {
  width: min(560px, 100%);
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--line);
  padding: 22px;
}

.gate-card h1 {
  margin-bottom: 12px;
}

.gate-card .form-title {
  display: block;
  width: 100%;
  white-space: nowrap;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1;
  text-align: left;
}

.gate-card p {
  color: var(--muted);
  line-height: 1.45;
}

.gate-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

#degen-form .gate-actions {
  grid-template-columns: 1fr 1fr;
}

.primary {
  min-height: 46px;
  border: 2px solid var(--line);
  background: var(--acid);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.notice {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
}

label,
fieldset {
  display: block;
  margin-top: 14px;
}

label,
legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

input[type="text"],
input:not([type]) {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: #fff;
}

fieldset {
  padding: 0;
  border: 0;
}

.form-divider {
  height: 2px;
  margin: 22px 0 18px;
  background: linear-gradient(90deg, var(--line), transparent);
  opacity: 0.35;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.segmented label {
  margin: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 2px solid var(--line);
  background: #fff;
  text-align: center;
  cursor: pointer;
}

.segmented label:nth-child(1) input:checked + span {
  background: var(--blue);
}

.segmented label:nth-child(2) input:checked + span {
  background: var(--violet);
  color: #fff;
}

.segmented label:nth-child(3) input:checked + span {
  background: var(--sol-green);
}

.preview {
  display: grid;
  grid-template-columns: 116px 1fr;
  align-items: center;
  gap: 18px;
  margin: 8px 0 18px;
}

.preview .avatar {
  width: 116px;
  height: 116px;
  margin: 0;
}

.avatar-upload {
  padding: 0;
  cursor: pointer;
}

.avatar-upload:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.preview .avatar span {
  width: 64px;
  height: 84px;
  border-radius: 34px 34px 0 0;
}

.preview .avatar span::before,
.preview .avatar span::after {
  top: 32px;
  width: 6px;
  height: 6px;
}

.preview .avatar span::before {
  left: 20px;
}

.preview .avatar span::after {
  right: 20px;
}

.image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 7vw, 74px);
  line-height: 0.92;
}

h2 {
  margin-bottom: 14px;
  font-size: 19px;
}

.daybox,
.panel {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--line);
}

.daybox {
  min-width: 118px;
  padding: 14px;
  text-align: center;
}

.daybox span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.daybox strong {
  font-size: 48px;
  line-height: 1;
}

.game {
  display: grid;
  grid-template-columns: 250px 1fr 1.2fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.profile {
  min-height: 392px;
}

.avatar {
  display: grid;
  place-items: end center;
  height: 180px;
  margin-bottom: 16px;
  border: 3px solid var(--line);
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(23, 23, 23, 0.12) 48% 52%, transparent 52%),
    #bdf4dc;
  overflow: hidden;
}

.avatar span {
  width: 100px;
  height: 132px;
  border: 3px solid var(--line);
  border-bottom: 0;
  border-radius: 48px 48px 0 0;
  background: linear-gradient(var(--hot) 0 28%, #f6b36d 28% 52%, #2f2f2f 52%);
  position: relative;
}

.avatar span::before,
.avatar span::after {
  content: "";
  position: absolute;
  top: 45px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.avatar span::before {
  left: 30px;
}

.avatar span::after {
  right: 30px;
}

.profile p {
  color: var(--muted);
  line-height: 1.45;
}

.handle {
  margin-bottom: 5px;
  color: var(--ink) !important;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.wallet {
  min-height: 20px;
  margin-bottom: 14px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ghost {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.ghost:hover,
.action:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.stat {
  margin-bottom: 13px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 700;
}

.meter {
  height: 18px;
  border: 2px solid var(--line);
  background: #fff;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--acid);
}

.meter[data-tone="bad"] span {
  background: var(--hot);
}

.meter[data-tone="warn"] span {
  background: var(--coin);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action {
  min-height: 86px;
  padding: 12px;
  border: 2px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.action strong {
  display: block;
  margin-bottom: 6px;
}

.action span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.log {
  grid-column: 2 / 4;
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#phase {
  padding: 5px 9px;
  border: 2px solid var(--line);
  background: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

ol {
  margin: 0;
  padding-left: 22px;
}

li {
  margin-bottom: 10px;
  line-height: 1.35;
}

li.good {
  color: #006b3f;
}

li.bad {
  color: #9d1535;
}

li.weird {
  color: #4b32a8;
}

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

  .log {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .daybox {
    min-width: 86px;
    padding: 10px;
  }

  .daybox strong {
    font-size: 34px;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .gate-actions,
  .segmented {
    grid-template-columns: 1fr;
  }

  .panel,
  .daybox {
    box-shadow: 4px 4px 0 var(--line);
  }
}
