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

html, body {
  height: 100%;
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

:root {
  --red: #ff6b6b;
  --trans-gradient: linear-gradient(
    180deg,
    #5bcefa 0%, #5bcefa 25%,
    #f5a9b8 25%, #f5a9b8 42%,
    #fff 42%, #fff 58%,
    #f5a9b8 58%, #f5a9b8 75%,
    #5bcefa 75%, #5bcefa 100%
  );
}

body {
  font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 30% 10%, #1a1a1a, #050505);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.shrine {
  width: 100%;
  max-width: 720px;
  text-align: center;
}

.frame {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 28px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  height: 700px;
  width: 700px;
  margin: 0 auto;
  transition: border-radius 0.5s ease;
}

.frame.washing {
  border-radius: 50%;
  animation: spin-drum 4s linear infinite;
}

@keyframes spin-drum {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.photo {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  border-radius: 6px;
  overflow: hidden;
  border: 6px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: border-radius 0.3s;
}

.photo.spinning {
  border-radius: 50%;
}

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

h1#name {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 12px;
  background: var(--trans-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 6px;
  margin-bottom: 14px;
}

.dates {
  opacity: 0.85;
  margin-bottom: 12px;
}

.birth-num,
.idnum .suf,
.idnum .match,
.postcode {
  color: var(--red);
}

.idnum-font {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 18px;
  font-weight: 600;
}

.idnum .mask,
.idnum .suf {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.gender-info {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
}

.trans-text {
  background: var(--trans-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.address-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(30, 30, 40, 0.18));
  border-radius: 16px;
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.22), 0 1.5px 6px rgba(255, 255, 255, 0.08) inset;
  padding: 26px 28px 18px;
  margin: 28px auto 0;
  max-width: 370px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  backdrop-filter: blur(6px) saturate(1.2);
  transition: box-shadow 0.3s, border 0.3s;
}

.address-card:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(255, 255, 255, 0.1) inset;
  border-color: var(--red);
}

.address-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 1.5px;
}

.address-row {
  font-size: 16px;
  color: #f3f3f3;
  padding-left: 2px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.address-row .postcode {
  font-weight: 700;
}

.address-row.hotline {
  color: #ffd6a0;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 1px;
}

.address-row.hotline span {
  color: #fff;
  background: linear-gradient(90deg, #ff6b6b 60%, #ffb86b);
  border-radius: 6px;
  padding: 2px 10px;
  margin-left: 6px;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.18);
}

@media (max-width: 520px) {
  .photo {
    width: 160px;
    height: 160px;
  }

  h1#name {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .frame {
    width: 100%;
    height: auto;
    min-height: 500px;
    padding: 20px 16px;
  }

  .frame.washing {
    width: min(100vw - 24px, 500px);
    height: min(100vw - 24px, 500px);
    min-height: unset;
  }

  .photo {
    width: 140px;
    height: 140px;
    margin-bottom: 12px;
  }

  h1#name {
    font-size: 32px;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .idnum-font {
    font-size: 14px;
  }

  .gender-info {
    font-size: 14px;
  }

  .address-card {
    padding: 16px 14px;
    max-width: 100%;
    margin-top: 16px;
  }

  .address-title {
    font-size: 16px;
  }

  .address-row {
    font-size: 14px;
  }

  .action-btn, .shuffle-btn, .bounce-btn, .reset-btn {
    padding: 10px 20px;
    font-size: 14px;
    margin: 12px 4px 0;
  }

  .reset-btn {
    margin-bottom: 12px;
  }
}

@media (max-width: 400px) {
  .frame {
    padding: 16px 12px;
    min-height: 450px;
  }

  .frame.washing {
    width: min(100vw - 24px, 400px);
    height: min(100vw - 24px, 400px);
    min-height: unset;
  }

  .photo {
    width: 120px;
    height: 120px;
  }

  h1#name {
    font-size: 26px;
  }

  .idnum-font {
    font-size: 12px;
  }

  .address-card {
    padding: 12px 10px;
    gap: 8px;
  }

  .address-title {
    font-size: 14px;
  }

  .address-row {
    font-size: 12px;
  }

  .action-btn, .shuffle-btn, .bounce-btn, .reset-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}


.action-btn, .shuffle-btn, .bounce-btn {
  display: none;
  margin: 20px 5px 0;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(30, 30, 40, 0.18));
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(6px) saturate(1.2);
  transition: box-shadow 0.3s, border 0.3s;
}

.reset-btn {
  display: none;
  margin: 0 auto 20px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(30, 30, 40, 0.18));
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(6px) saturate(1.2);
  transition: box-shadow 0.3s, border 0.3s;
}

.action-btn.show, .reset-btn.show, .shuffle-btn.show, .bounce-btn.show {
  display: inline-block;
}

.action-btn:hover, .reset-btn:hover, .shuffle-btn:hover, .bounce-btn:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
  border-color: var(--red);
}