:root {
  --bg: #1e1f22;
  --card: #2b2d31;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --input: #1e1f22;
  --accent: #5865f2;
  --bravery: #faa61a;
  --brilliance: #3b88f6;
  --balance: #9c84ef;
  --danger: #ed4245;
  --success: #57f287;
}

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

body {
  font-family: "Whitney", "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  font-size: 14px;
  font-family: "Consolas", monospace;
  outline: 1px solid transparent;
}

.field input:focus {
  outline-color: var(--accent);
}

.token-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

button {
  cursor: pointer;
  font-family: inherit;
}

.ghost {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.ghost:hover {
  background: rgba(88, 101, 242, 0.15);
}

.houses {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.house {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.house:hover {
  transform: translateY(-2px);
}

.house:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.house.bravery:hover,
.house.bravery.loading {
  border-color: var(--bravery);
  box-shadow: 0 4px 16px rgba(250, 166, 26, 0.25);
}

.house.brilliance:hover,
.house.brilliance.loading {
  border-color: var(--brilliance);
  box-shadow: 0 4px 16px rgba(59, 136, 246, 0.25);
}

.house.balance:hover,
.house.balance.loading {
  border-color: var(--balance);
  box-shadow: 0 4px 16px rgba(156, 132, 239, 0.25);
}

.house .emblem {
  font-size: 28px;
}

.house .name {
  font-size: 13px;
  font-weight: 700;
}

.unequip {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--danger);
  background: rgba(237, 66, 69, 0.12);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.unequip:hover:not(:disabled) {
  background: rgba(237, 66, 69, 0.25);
}

.unequip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.status {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}

.status.ok {
  color: var(--success);
}

.status.err {
  color: var(--danger);
}

.status.info {
  color: var(--muted);
}

.disclaimer {
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
