:root {
  color-scheme: light;
  --bg: #eef4ff;
  --bg-2: #f4efff;
  --card: #ffffff;
  --text: #101827;
  --muted: #64748b;
  --line: #d8e3f2;
  --blue: #2f6df6;
  --blue-2: #2593f3;
  --green: #22c765;
  --red: #f3424b;
  --yellow: #ffd84d;
  --soft-blue: #eaf3ff;
  --soft-green: #ecfff2;
  --soft-red: #fff0f1;
  --shadow: 0 10px 24px rgba(42, 70, 132, 0.12);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 12px calc(86px + env(safe-area-inset-bottom));
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade-in 140ms ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 2px;
}

.topbar h1,
.page-card h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.icon-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
}

.icon-button:active,
.nav-item:active,
.tile:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.profile-card,
.page-card,
.points-card,
.task-card,
.bike-card,
.booking-card,
.history-card,
.game-card,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.profile-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.logo {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(49, 76, 140, 0.12);
  color: var(--blue);
}

.profile-title {
  margin: 0 0 3px;
  font-size: 21px;
  font-weight: 800;
}

.profile-subtitle,
.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.points-card {
  padding: 24px 18px;
  color: #ffffff;
  border: 0;
  text-align: center;
  background: linear-gradient(135deg, #33a0ff 0%, #3650df 100%);
}

.points-card strong {
  display: block;
  font-size: 62px;
  line-height: 0.95;
}

.points-card span {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
}

.points-card small {
  display: block;
  margin-top: 10px;
  font-size: 13px;
}

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

.tile {
  display: flex;
  min-height: 102px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: center;
}

.tile strong {
  font-size: 17px;
}

.tile span {
  max-width: 130px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.tile .danger {
  color: var(--red);
}

.tile .success {
  color: var(--green);
}

.tile .primary {
  color: var(--blue);
}

.wide-tile {
  grid-column: 1 / -1;
  min-height: 92px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.bottom-nav-inner {
  display: grid;
  width: 100%;
  max-width: 430px;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.nav-item {
  display: flex;
  height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.nav-item.active {
  color: var(--blue);
  background: #eaf3ff;
}

.page-card {
  padding: 18px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d3dfef;
  border-radius: 8px;
  background: #f0f6ff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #7eb2ff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.primary-button,
.secondary-button,
.danger-button,
.success-button {
  display: inline-flex;
  min-height: 48px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: var(--blue);
}

.success-button {
  color: #ffffff;
  background: var(--green);
}

.danger-button {
  color: #ffffff;
  background: var(--red);
}

.secondary-button {
  color: var(--text);
  background: #eef5ff;
  border: 1px solid #d5e3f5;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  box-shadow: none;
}

.notice.success {
  color: #087734;
  background: var(--soft-green);
  border-color: #a9efc3;
}

.notice.danger {
  color: #bb1f2a;
  background: var(--soft-red);
  border-color: #ffb9be;
}

.notice.info {
  color: #1f58c7;
  background: var(--soft-blue);
  border-color: #a9cdff;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid #cfe0f6;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 0 13px;
  font-weight: 700;
}

.chip.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eaf3ff;
}

.bike-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bike-card {
  overflow: hidden;
}

.bike-photo {
  position: relative;
  min-height: 178px;
  background: #dce8f7;
}

.bike-photo img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.status-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  color: #ffffff;
  background: rgba(16, 24, 39, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.bike-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.bike-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bike-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.bike-type {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.price {
  flex: 0 0 auto;
  text-align: right;
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
}

.price small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.spec {
  min-height: 58px;
  border-radius: 8px;
  background: #f3f7fc;
  padding: 8px;
  text-align: center;
}

.spec strong {
  display: block;
  font-size: 13px;
}

.spec span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.detail-hero {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
}

.detail-hero img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.booking-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f3f8ff;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.task-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #eaf3ff;
}

.task-card h3,
.history-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.25;
}

.task-card p,
.history-card p {
  margin: 0;
  color: var(--muted);
}

.task-badge {
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  background: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.history-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #f3f7fc;
}

.history-points {
  color: var(--green);
  font-weight: 900;
}

.mini-game {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-card {
  overflow: hidden;
  background: #dcecff;
}

.game-scene {
  position: relative;
  height: 320px;
  overflow: hidden;
  background: linear-gradient(180deg, #dceeff 0%, #edf5ff 62%, #687384 63%, #687384 100%);
}

.road-line {
  position: absolute;
  right: 0;
  bottom: 46px;
  left: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, #d5dbe2 0 20px, transparent 20px 42px);
}

.bike-runner {
  position: absolute;
  left: 40px;
  bottom: 74px;
  width: 78px;
  height: 54px;
  transition: bottom 160ms ease-out;
}

.bike-runner.jump {
  bottom: 142px;
}

.obstacle {
  position: absolute;
  right: -60px;
  bottom: 76px;
  width: 42px;
  height: 42px;
  border-radius: 5px;
  background: linear-gradient(180deg, #ff9d2f, #f15137);
  animation: ride-obstacle 1.45s linear infinite;
}

@keyframes ride-obstacle {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-470px);
  }
}

.cloud {
  position: absolute;
  width: 70px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
}

.cloud.one {
  top: 54px;
  left: 34px;
}

.cloud.two {
  top: 74px;
  right: 36px;
}

.progress-card {
  padding: 14px;
  text-align: center;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e2ee;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.empty-state {
  padding: 26px 18px;
  color: var(--muted);
  text-align: center;
}

.registration-card {
  margin-top: 12px;
}

@media (max-width: 360px) {
  .points-card strong {
    font-size: 54px;
  }

  .task-card,
  .history-card {
    grid-template-columns: 42px 1fr;
  }

  .task-badge,
  .history-points {
    grid-column: 2;
    justify-self: start;
  }

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