:root {
  --ink: #14222a;
  --muted: #68727a;
  --paper: #fffdf7;
  --wash: #f7f3e8;
  --teal: #28786f;
  --blue: #1f4e67;
  --yuzu: #f4b942;
  --coral: #cf604e;
  --line: rgba(20, 34, 42, 0.16);
  --shadow: 0 24px 70px rgba(20, 34, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(244, 185, 66, 0.2), transparent 28rem),
    linear-gradient(135deg, #f9f6ed 0%, #eef6f3 55%, #f8f1ec 100%);
  min-height: 100vh;
}

body.test-mode {
  padding-bottom: 86px;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1060px, calc(100% - 32px));
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(300px, 0.78fr);
  gap: clamp(20px, 3.5vw, 44px);
  align-items: center;
  padding: 28px 0 22px;
}

.today-panel,
.queue-panel {
  width: 100%;
}

.queue-panel[hidden] {
  display: none;
}

body:not(.test-mode) .shell {
  width: min(620px, calc(100% - 32px));
  grid-template-columns: 1fr;
}

.date-strip {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--blue);
}

#dateLabel {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3.4vw, 2.9rem);
  line-height: 0.95;
}

#weekdayLabel {
  border-left: 2px solid var(--yuzu);
  padding-left: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
}

.reward-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 520px);
  height: 560px;
  margin: 0 auto;
  padding: 34px 34px 28px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: start;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(40, 120, 111, 0.08) 0 10px, transparent 10px),
    var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.reward-card::after {
  content: "";
  position: absolute;
  inset: auto 22px 18px auto;
  width: 70px;
  height: 70px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(20, 34, 42, 0.08) 49%, transparent 50%),
    repeating-linear-gradient(0deg, rgba(244, 185, 66, 0.28) 0 3px, transparent 3px 11px);
  clip-path: polygon(0 0, 100% 30%, 70% 100%, 10% 78%);
  opacity: 0.55;
}

.paper-pin {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 44px;
  height: 6px;
  margin: 0;
  background: var(--coral);
  transform: rotate(-3deg);
  border-radius: 999px;
}

.kicker,
.section-head p,
.disclosure {
  margin: 0;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

.reward-card .kicker {
  position: absolute;
  top: 40px;
  left: 28px;
  width: 7em;
  text-align: left;
  line-height: 1.3;
}

.reward-main {
  align-self: start;
  display: flex;
  min-height: 0;
  width: 100%;
  padding-top: 4px;
  flex-direction: column;
  align-items: center;
}

.reward-mark {
  display: grid;
  place-items: center;
  width: clamp(140px, 17vw, 172px);
  height: clamp(140px, 17vw, 172px);
  margin-top: 0;
  border: 1px solid rgba(40, 120, 111, 0.12);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(244, 185, 66, 0.14), rgba(40, 120, 111, 0.08));
  font-size: clamp(5rem, 9vw, 6.8rem);
  line-height: 1;
}

h1 {
  align-self: start;
  width: 100%;
  margin: 14px 0 0;
  max-width: 15em;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  font-weight: 800;
  line-height: 1.28;
  line-break: strict;
  text-align: center;
  text-wrap: balance;
  white-space: pre-line;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

h1.long-title {
  font-size: clamp(1.28rem, 2vw, 1.78rem);
}

.catch {
  margin: 12px 0 0;
  max-width: 22em;
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  font-weight: 800;
  line-height: 1.55;
  line-break: strict;
  text-wrap: balance;
  white-space: pre-line;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.body-copy {
  margin: 10px 0 0;
  max-width: 24em;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
  line-break: strict;
  text-wrap: balance;
  white-space: pre-line;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cta-area {
  position: relative;
  z-index: 3;
  align-self: end;
  min-height: 48px;
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.disclosure {
  color: var(--coral);
}

.cta {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
}

.actions {
  display: grid;
  width: min(100%, 520px);
  grid-template-columns: 50px 1fr 50px;
  gap: 10px;
  margin: 16px auto 0;
}

.actions button,
.platform-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.72);
  cursor: pointer;
}

.actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.actions button:focus-visible,
.platform-tabs button:focus-visible,
.cta:focus-visible {
  outline: 3px solid rgba(244, 185, 66, 0.7);
  outline-offset: 3px;
}

.queue-panel {
  padding: 22px;
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  font-weight: 500;
}

.platform-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.platform-tabs button.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.queue-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.queue-item {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.queue-text {
  margin: 10px 0 0;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.6;
}

.site-foot {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-foot a {
  color: inherit;
}

.test-controls {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(20, 34, 42, 0.18);
  backdrop-filter: blur(16px);
}

.test-controls[hidden] {
  display: none;
}

.test-status {
  display: flex;
  gap: 10px;
  align-items: baseline;
  white-space: nowrap;
}

.test-status strong {
  color: var(--teal);
  font-size: 0.84rem;
}

.test-status span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.test-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(48px, auto)) minmax(132px, 1fr) repeat(4, minmax(48px, auto));
  gap: 8px;
}

.test-actions button,
.test-actions input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fffdf7;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.test-actions button {
  cursor: pointer;
}

.test-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.test-actions input {
  padding: 0 10px;
}

.policy-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
  line-height: 1.9;
}

.policy-page h1 {
  max-width: none;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
}

.policy-page a {
  color: var(--teal);
  font-weight: 800;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .reward-card {
    height: 548px;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .test-controls {
    grid-template-columns: 1fr;
  }

  .test-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding-top: 18px;
  }

  .reward-card {
    height: 530px;
    padding: 26px 22px;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .reward-mark {
    width: 126px;
    height: 126px;
    margin-top: 0;
    font-size: 4.6rem;
  }

  .paper-pin {
    top: 20px;
    left: 22px;
  }

  .reward-card .kicker {
    top: 36px;
    left: 22px;
  }

  .queue-panel {
    padding: 18px;
  }

  .platform-tabs {
    grid-template-columns: 1fr;
  }

  .test-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .test-actions input {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reward-card,
  .queue-item {
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

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