@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@600&family=DM+Sans:wght@400;600;700&display=swap');

:root {
  --bg: #F5F0E8;
  --ink: #1A1A1A;
  --card-green: #E4EAD8;
  --card-warm: #FDF3D8;
  --card-muted: #EDE8DF;
  --white: #ffffff;
  --cream-text: #F5F0E8;
  --text-muted: #808080;
  --text-muted-light: #aaaaaa;
  --input-border: #C8C4BA;
  --danger: #a4402f;
  --danger-soft: #f4e1da;
  --radius-card: 20px;
  --radius-sm: 10px;
  --radius-btn: 8px;
  --shadow-hard: 3px 4px 0px var(--ink);
  --shadow-hard-hover: 2px 3px 0px var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2.5rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 'DM Sans', sans-serif;
}

main {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

h1 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 2rem;
  margin: 0;
}

h1 .subtitle {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

h1 .subtitle a {
  color: inherit;
}

section {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 1.75rem;
}

section > h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 1rem;
}

.status-line {
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  font-size: 1.1rem;
}

.now-playing img {
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-card {
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.account-name {
  font-weight: 700;
  font-size: 1.15rem;
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--card-green);
  color: var(--ink);
  vertical-align: middle;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.actions form {
  display: inline;
}

button, input[type="submit"] {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-hard);
  padding: 0.7rem 1.4rem;
  transition: box-shadow 0.1s ease, transform 0.1s ease;
}

button:hover, input[type="submit"]:hover {
  box-shadow: var(--shadow-hard-hover);
  transform: translate(1px, 1px);
}

button:active, input[type="submit"]:active {
  box-shadow: 0px 0px 0px var(--ink);
  transform: translate(3px, 4px);
}

.btn-primary {
  background: var(--ink);
  color: var(--cream-text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--cream-text);
}

.onboard-form, .card-link-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.onboard-form input[type="text"], .card-link-form input[type="text"] {
  flex: 1;
  min-width: 12rem;
}

@media (max-width: 600px) {
  .onboard-form, .card-link-form {
    flex-direction: column;
    align-items: stretch;
  }

  .onboard-form button, .card-link-form button {
    width: 100%;
  }
}

input[type="text"] {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  background: var(--white);
  color: var(--ink);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--ink);
}

input[type="text"]::placeholder {
  color: var(--text-muted-light);
}

label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 14px;
  color: var(--text-muted);
}

input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
}

details > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
}

details[open] > summary {
  margin-bottom: 1rem;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.25rem;
}

dt {
  font-weight: 700;
  white-space: nowrap;
}

dd {
  margin: 0;
  color: var(--text-muted);
}

.empty {
  color: var(--text-muted);
  font-style: italic;
}

.profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 9.5rem;
  aspect-ratio: 3 / 4;
  padding: 1.25rem;
  border-radius: var(--radius-card);
  background: var(--card-muted);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}

.profile-card .avatar {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}

.profile-card:hover {
  background: var(--ink);
  color: var(--cream-text);
}

.profile-card:hover .avatar {
  background: var(--cream-text);
  color: var(--ink);
}

code {
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.9em;
  word-break: break-all;
}

/* --- user.html: profile page --- */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.profile-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 52px;
  line-height: 1.1;
  margin: 0;
}

.switch-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 14px;
  color: var(--text-muted);
}

.now-playing-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 190px;
  flex-shrink: 0;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.now-playing-widget .np-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
}

.np-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.np-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.np-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-title.np-empty {
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
}

.card {
  border-radius: var(--radius-card);
  padding: 1.75rem;
  background: var(--white);
}

.card-green {
  background: var(--card-green);
}

.card-warm {
  background: var(--card-warm);
}

.card-muted {
  background: var(--card-muted);
}

.card h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 0.75rem;
}

.card .muted {
  color: var(--text-muted);
  margin: 0;
}

.card-link-form {
  margin-top: 1.25rem;
}

.error-text {
  color: var(--danger);
  margin: 1rem 0 0;
}

.result-box {
  position: relative;
  margin-top: 1.25rem;
  background: var(--white);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius-sm);
  padding: 1rem 5.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.result-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.result-value {
  font-style: italic;
  font-size: 14px;
  word-break: break-all;
}

.btn-copy {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  font-size: 12px;
  padding: 6px 14px;
  box-shadow: var(--shadow-hard-hover);
  border-width: 2px;
}

.disclosure {
  margin-top: -0.5rem;
}

.disclosure summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure .chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.disclosure[open] .chevron {
  transform: rotate(90deg);
}

.disclosure .disclosure-content {
  margin-top: 0.75rem;
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
}
