:root {
  --ink: #17202a;
  --night: #0f172a;
  --warm: #fb923c;
  --paper: #f8fafc;
  --fog: #e2e8f0;
  --ui-font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--ui-font);
  color: var(--ink);
}

.clicker-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.34), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(245, 158, 11, 0.28), transparent 40%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 42%, #334155 100%);
}

.clicker-shell {
  width: min(760px, 92vw);
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow: 0 28px 54px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(3px);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.75), rgba(30, 41, 59, 0.9));
  color: #e2e8f0;
}

.hero-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.auth-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.clicker-head h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overline {
  margin: 0 0 8px 0;
  color: #7dd3fc;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
}

.muted {
  margin: 8px 0 22px 0;
  color: #bfdbfe;
}

.click-orb {
  width: min(470px, 88vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 999px;
  border: 8px solid rgba(250, 204, 21, 0.28);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1) 28%, transparent 35%),
    radial-gradient(circle at 50% 60%, #fb923c 0%, #f97316 40%, #b45309 100%);
  color: #fff7ed;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow:
    0 0 0 10px rgba(251, 146, 60, 0.14),
    0 24px 48px rgba(124, 45, 18, 0.45),
    inset 0 10px 18px rgba(255, 255, 255, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.click-orb:hover {
  transform: translateY(-3px);
}

.click-orb:active {
  transform: translateY(1px);
}

.orb-label {
  display: block;
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 12px;
}

.orb-count {
  display: block;
  margin-top: 12px;
  font-size: clamp(48px, 11vw, 108px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 8px 18px rgba(120, 53, 15, 0.5);
}

.clicker-foot {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.click-note {
  margin: 0;
  color: #cbd5e1;
  text-align: right;
}

.inline-link,
.ghost-link,
.chat-link {
  color: #7dd3fc;
  text-decoration: none;
  border-bottom: 1px dashed rgba(125, 211, 252, 0.6);
}

.inline-link:hover,
.ghost-link:hover,
.chat-link:hover {
  color: #67e8f9;
}

.ghost-link {
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(125, 211, 252, 0.14);
  color: #e0f2fe;
  font-size: 13px;
}

.chat-body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02)),
    repeating-linear-gradient(
      45deg,
      rgba(148, 163, 184, 0.12) 0px,
      rgba(148, 163, 184, 0.12) 8px,
      transparent 8px,
      transparent 16px
    ),
    #f8fafc;
}

.chat-page {
  width: min(1080px, 100%);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.16);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
}

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

.chat-top h1 {
  margin: 0;
}

.chat-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.post-box {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 8px;
}

.post-box-bottom {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid #dbe4ee;
}

button,
input {
  border-radius: 10px;
  border: 1px solid #94a3b8;
  padding: 10px 12px;
  font-size: 15px;
}

button {
  background: linear-gradient(135deg, var(--night), #334155);
  color: #fff;
  border-color: #0f172a;
  cursor: pointer;
}

.attachments {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--fog);
  background: #f8fafc;
}

.attachments h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.attachments ul {
  margin: 0;
  padding-left: 18px;
  columns: 2;
}

.attachments li {
  margin-bottom: 6px;
}

.messages {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  border-radius: 14px;
  border: 1px solid #dbe4ee;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  padding: 6px 10px 14px 6px;
}

.messages::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
}

.messages::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.5);
}

.message {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.message header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #334155;
  gap: 8px;
}

.message p {
  margin: 0;
  word-break: break-word;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 12% 15%, rgba(34, 211, 238, 0.2), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(251, 146, 60, 0.2), transparent 32%),
    linear-gradient(135deg, #e2e8f0 0%, #f8fafc 48%, #e2e8f0 100%);
}

.auth-card {
  width: min(520px, 94vw);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dbe4ee;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.account-card {
  width: min(700px, 95vw);
}

.auth-muted {
  margin: 10px 0 0 0;
  color: #64748b;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.notice {
  margin: 16px 0 0 0;
  padding: 10px 12px;
  border-radius: 10px;
}

.notice-ok {
  background: #ecfeff;
  color: #155e75;
}

.notice-error {
  background: #fff1f2;
  color: #9f1239;
}

.hint-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

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

.account-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fafc;
}

.blank-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #dbe4ee;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.mini-shell {
  width: min(820px, 96vw);
}

.mini-value {
  margin: 8px 0 0 0;
  font-size: clamp(36px, 8vw, 54px);
  font-weight: 800;
  color: #0f172a;
}

.mini-result {
  margin: 0;
  font-weight: 600;
  color: #334155;
}

.rps-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #dbe4ee;
  text-align: left;
  vertical-align: top;
}

.leaderboard-table th {
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-output {
  min-height: 70px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  word-break: break-word;
}

@media (max-width: 760px) {
  .hero-top,
  .clicker-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-strip,
  .chat-meta,
  .auth-links {
    justify-content: flex-start;
  }

  .post-box,
  .account-grid,
  .rps-actions {
    grid-template-columns: 1fr;
  }

  .chat-page {
    height: 100%;
    padding: 18px;
  }

  .attachments ul {
    columns: 1;
  }
}
