:root {
  --coral: #ef6255;
  --coral-dark: #d94c45;
  --orange: #f59d3d;
  --cream: #fff8f1;
  --cream-deep: #f8ede2;
  --ink: #24323d;
  --muted: #71808a;
  --line: #eadfd5;
  --white: #ffffff;
  --mint: #47a985;
  --mint-soft: #e9f7f1;
  --danger: #dc4f4b;
  --shadow: 0 18px 44px rgba(62, 37, 24, 0.12);
  --soft-shadow: 0 8px 24px rgba(62, 37, 24, 0.08);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eee8e1;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(245, 157, 61, 0.12), transparent 28rem),
    linear-gradient(145deg, #f7f3ef, #ebe5df);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(239, 98, 85, 0.28);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-frame {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.page {
  min-height: 100vh;
  padding-bottom: calc(94px + var(--safe-bottom));
}

.spin-only-frame {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.025) 0 1px, transparent 1px 5px),
    #f33f82;
}

.spin-only-frame .page {
  width: 100%;
  min-height: auto;
  padding: 0;
}

.spin-only-frame .top-hero,
.spin-only-frame .stat-grid,
.spin-only-frame .content-section,
.spin-only-frame .draw-button-wrap {
  display: none;
}

.spin-only-frame .home-content {
  margin: 0;
  padding: 20px;
}

.spin-only-frame .draw-stage {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.spin-only-frame .wheel-frame {
  width: min(94vw, 460px);
  height: min(94vw, 460px);
  padding: 10px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 24px 60px rgba(104, 11, 55, 0.25), 0 0 0 5px rgba(255, 255, 255, 0.34);
}

.spin-only-frame .wheel {
  width: 100%;
  height: 100%;
}

.spin-only-frame .wheel-label {
  width: 100px;
  margin-left: -50px;
  font-size: clamp(7px, 2.4vw, 11px) !important;
  transform: rotate(var(--angle)) translateY(max(-130px, -27vw)) rotate(90deg);
  transform-origin: 50px 0;
}

.spin-only-frame .wheel-center {
  width: 76px;
  height: 76px;
  font-size: 11px;
}

.spin-only-frame .spin-direction {
  font-size: 22px;
}

.spin-only-frame .wheel-fixed-pointer {
  display: none;
}

.reference-frame {
  min-height: 100vh;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.025) 0 1px, transparent 1px 5px),
    #f33f82;
}

.wheel-page {
  min-height: 100vh;
  padding-bottom: 0;
}

.reference-toolbar {
  display: flex;
  min-height: 86px;
  align-items: flex-end;
  gap: 4px;
  padding: max(18px, env(safe-area-inset-top)) 10px 10px;
  color: white;
  background: #3ea857;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-button {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: white;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.toolbar-button:active {
  background: rgba(255, 255, 255, 0.16);
}

.toolbar-button svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.member-tool span {
  position: absolute;
  right: 1px;
  bottom: 0;
  min-width: 21px;
  height: 18px;
  padding: 1px 5px;
  color: #255d35;
  border-radius: 9px;
  background: #d7ead8;
  font-size: 10px;
  font-weight: 800;
}

.reference-heading {
  position: relative;
  min-height: 164px;
  padding: 15px 20px 10px 54px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.reference-heading h1 {
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 500;
  letter-spacing: -0.6px;
}

.reference-heading p {
  margin: 18px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.24);
  font-size: clamp(34px, 10vw, 50px);
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-bookmark {
  position: absolute;
  top: 18px;
  left: 16px;
  display: grid;
  width: 22px;
  height: 31px;
  place-items: start center;
  color: #f33f82;
  background: white;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  font-size: 15px;
  font-weight: 700;
}

.reference-frame .home-content {
  margin: -6px 0 0;
  padding: 0 14px 40px;
}

.reference-frame .draw-stage {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.reference-frame .wheel-frame {
  width: min(94vw, 450px);
  height: min(94vw, 450px);
  padding: 9px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 17px 35px rgba(119, 18, 59, 0.2);
}

.reference-frame .wheel {
  width: 100%;
  height: 100%;
}

.reference-frame .wheel-label {
  width: 112px;
  margin-left: -56px;
  font-size: clamp(8px, 2.8vw, 13px) !important;
  transform: rotate(var(--angle)) translateY(max(-142px, -29vw)) rotate(90deg);
  transform-origin: 56px 0;
}

.reference-frame .wheel-center,
.spin-only-frame .wheel-center {
  width: 78px;
  height: 78px;
  border-width: 4px;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(42, 20, 38, 0.34);
}

.reference-frame .wheel-center::before,
.spin-only-frame .wheel-center::before {
  position: absolute;
  z-index: -1;
  top: -20px;
  left: 50%;
  content: "";
  transform: translateX(-50%);
  border-right: 18px solid transparent;
  border-bottom: 29px solid #242128;
  border-left: 18px solid transparent;
}

.reference-frame .wheel-fixed-pointer,
.spin-only-frame .wheel-fixed-pointer,
.reference-frame .draw-button-wrap,
.reference-frame .stat-grid,
.reference-frame .content-section {
  display: none;
}

.top-hero {
  position: relative;
  min-height: 312px;
  padding: 22px 22px 84px;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #ef5c52 2%, #f16c4c 48%, #f8a43d 100%);
  border-radius: 0 0 48% 12% / 0 0 16% 8%;
}

.top-hero::before,
.top-hero::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.top-hero::before {
  width: 250px;
  height: 250px;
  right: -110px;
  top: -118px;
}

.top-hero::after {
  width: 130px;
  height: 130px;
  left: -72px;
  bottom: 22px;
}

.brand-row,
.section-header,
.inline-row,
.nav-items,
.modal-actions,
.stat-grid,
.setting-row,
.member-row,
.history-row {
  display: flex;
  align-items: center;
}

.brand-row {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.45px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: inherit;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
}

.icon-button svg,
.nav-item svg,
.field-icon svg,
.btn svg,
.info-box svg,
.stat-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome {
  position: relative;
  z-index: 1;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 330px;
  font-size: clamp(29px, 8vw, 38px);
  line-height: 1.14;
  letter-spacing: -1.5px;
}

.cycle-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(125, 53, 27, 0.12);
  font-size: 11px;
  font-weight: 700;
}

.home-content {
  position: relative;
  z-index: 2;
  margin-top: -91px;
  padding: 0 18px 28px;
}

.draw-stage {
  position: relative;
  min-height: 294px;
  padding: 18px 16px;
  border: 1px solid rgba(229, 213, 200, 0.9);
  border-radius: 30px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow);
}

.wheel-frame {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 50%;
  background: #7145a4;
  box-shadow: 0 12px 28px rgba(79, 49, 115, 0.24), 0 0 0 4px white;
}

.wheel {
  position: relative;
  width: 204px;
  height: 204px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.88), inset 0 0 24px rgba(44, 28, 62, 0.12);
  transition: transform 3.2s cubic-bezier(0.12, 0.68, 0.13, 1);
}

.wheel-fixed-pointer {
  position: absolute;
  z-index: 5;
  top: -9px;
  content: "";
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-top: 28px solid #25222a;
  border-right: 15px solid transparent;
  border-left: 15px solid transparent;
  filter: drop-shadow(0 3px 2px rgba(36, 24, 42, 0.3));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: flex;
  width: 58px;
  height: 58px;
  padding: 0;
  transform: translate(-50%, -50%);
  place-items: center;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: white;
  border: 5px solid white;
  border-radius: 50%;
  background: #242128;
  box-shadow: 0 4px 12px rgba(35, 26, 41, 0.4);
  font-size: 9px;
  font-weight: 800;
}

.spin-direction {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  border-radius: 50%;
  font-weight: 800;
}

.wheel-label {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 84px;
  margin-left: -42px;
  color: white;
  font-size: var(--label-size, 9px);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 2px rgba(35, 22, 45, 0.36);
  transform: rotate(var(--angle)) translateY(-70px) rotate(90deg);
  transform-origin: 42px 0;
  white-space: normal;
}

.draw-button-wrap {
  margin: 18px 12px 0;
}

.btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 19px;
  color: var(--ink);
  border: 0;
  border-radius: 16px;
  background: white;
  font-size: 14px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  width: 100%;
  color: white;
  background: linear-gradient(100deg, var(--coral), #f2554d);
  box-shadow: 0 10px 20px rgba(239, 98, 85, 0.26);
}

.btn-primary:hover {
  box-shadow: 0 13px 26px rgba(239, 98, 85, 0.31);
}

.btn-secondary {
  color: #59656d;
  border: 1px solid #d9dfe2;
}

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

.btn-ghost {
  min-height: 40px;
  padding: 0 11px;
  color: var(--coral);
  background: transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.stat-grid {
  gap: 10px;
  margin-top: 15px;
}

.stat-card {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--coral);
  border-radius: 50%;
  background: #ffebe5;
}

.stat-card:nth-child(2) .stat-icon {
  color: var(--mint);
  background: var(--mint-soft);
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.content-section {
  padding: 22px 2px 0;
}

.section-header {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.35px;
}

.text-link {
  padding: 6px;
  color: var(--coral);
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 800;
}

.list-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.winner-row,
.member-row,
.history-row {
  min-height: 66px;
  gap: 11px;
  padding: 11px 13px;
  border-bottom: 1px solid #f0e7df;
}

.winner-row:last-child,
.member-row:last-child,
.history-row:last-child {
  border-bottom: 0;
}

.avatar {
  width: 39px;
  height: 39px;
  background: var(--avatar, #47a985);
  font-size: 12px;
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tag {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: #318263;
  border-radius: 8px;
  background: var(--mint-soft);
  font-size: 9px;
  font-weight: 800;
}

.mode-tag.admin {
  color: #a85a20;
  background: #fff0dd;
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 13px;
  place-items: center;
  color: var(--coral);
  border-radius: 19px;
  background: #ffebe5;
  font-size: 25px;
}

.empty-state strong {
  display: block;
  font-size: 14px;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.page-header {
  position: sticky;
  z-index: 5;
  top: 0;
  padding: max(18px, env(safe-area-inset-top)) 18px 17px;
  color: white;
  background: #3ea857;
  box-shadow: 0 6px 22px rgba(38, 122, 63, 0.2);
}

.page-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.page-header h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.55px;
}

.page-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 600;
}

.page-content {
  padding: 17px;
}

.search-box,
.field {
  position: relative;
}

.search-box {
  margin-bottom: 14px;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  display: grid;
  color: #9aa4aa;
  transform: translateY(-50%);
}

.field-icon svg {
  width: 17px;
  height: 17px;
}

.input,
.select,
.textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid #d9dfe2;
  border-radius: 13px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input,
.select {
  height: 49px;
  padding: 0 13px;
}

.search-box .input,
.field.has-icon .input {
  padding-left: 41px;
}

.textarea {
  min-height: 88px;
  padding: 13px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--coral);
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 98, 85, 0.1);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #4c5a63;
  font-size: 11px;
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 13px;
}

.member-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
}

.member-actions {
  display: flex;
  flex: 0 0 auto;
}

.delete-button {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #9c7371;
  border: 0;
  border-radius: 11px;
  background: #fff2f0;
}

.delete-button svg {
  width: 17px;
  height: 17px;
}

.settings-card {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}

.settings-card-title {
  margin: 0;
  padding: 15px 16px 10px;
  color: #d64677;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.setting-row {
  min-height: 65px;
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid #f1e9e2;
}

.setting-row.clickable {
  cursor: pointer;
}

.setting-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: #318d4b;
  border-radius: 12px;
  background: #e8f6ec;
}

.setting-icon svg {
  width: 19px;
  height: 19px;
}

.setting-content {
  min-width: 0;
  flex: 1;
}

.setting-content strong {
  display: block;
  font-size: 12px;
}

.setting-content span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.chevron {
  color: #a4adb2;
}

.chevron svg {
  width: 17px;
  height: 17px;
}

.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  color: #2f745d;
  border: 1px solid #bfe5d5;
  border-radius: 13px;
  background: #effaf5;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.info-box svg {
  flex: 0 0 auto;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(225, 213, 203, 0.85);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -8px 24px rgba(64, 42, 30, 0.07);
  backdrop-filter: blur(16px);
}

.nav-items {
  justify-content: space-around;
}

.nav-item {
  display: grid;
  min-width: 70px;
  gap: 3px;
  justify-items: center;
  padding: 7px 8px;
  color: #6d767c;
  border: 0;
  border-radius: 13px;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.nav-item.active {
  color: #318d4b;
  background: #e8f6ec;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px;
  background: rgba(43, 36, 33, 0.62);
  animation: fadeIn 160ms ease both;
}

.modal {
  width: min(100%, 440px);
  max-height: min(88vh, 680px);
  overflow-y: auto;
  padding: 19px;
  border-radius: 23px;
  background: white;
  box-shadow: 0 25px 70px rgba(26, 19, 16, 0.3);
  animation: slideUp 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 17px;
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.6px;
}

.close-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #778188;
  border: 0;
  border-radius: 12px;
  background: #f5f5f4;
}

.close-button svg {
  width: 20px;
  height: 20px;
}

.modal-actions {
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1;
}

.result-modal {
  padding-top: 27px;
  text-align: center;
  overflow: hidden;
}

.result-crown {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 11px;
  place-items: center;
  color: #ef9a30;
  border-radius: 18px;
  background: #fff3df;
}

.result-crown svg {
  width: 29px;
  height: 29px;
}

.result-avatar {
  display: grid;
  width: 94px;
  height: 94px;
  margin: 13px auto;
  place-items: center;
  color: white;
  border: 7px solid #fff2e8;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--orange));
  box-shadow: 0 10px 28px rgba(239, 98, 85, 0.25);
  font-size: 27px;
  font-weight: 800;
}

.result-modal h2 {
  margin: 0;
  font-size: 24px;
}

.result-modal .winner-name {
  margin: 7px 0 0;
  color: var(--coral-dark);
  font-size: 20px;
  font-weight: 800;
}

.result-note {
  margin: 10px auto 18px;
  max-width: 290px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.winner-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  background: rgba(7, 17, 30, 0.84);
  animation: fadeIn 180ms ease both;
}

.winner-ribbon {
  display: flex;
  width: 116%;
  min-height: 105px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 46px;
  color: white;
  border-top: 7px solid white;
  border-bottom: 7px solid white;
  background: #6377d2;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.36);
  text-align: center;
  transform: rotate(-6deg);
  animation: ribbonIn 520ms cubic-bezier(0.16, 0.8, 0.25, 1) both;
}

.winner-ribbon strong {
  max-width: 78%;
  font-size: clamp(27px, 8vw, 43px);
  line-height: 1.08;
  letter-spacing: -1px;
}

.winner-ribbon span {
  font-size: clamp(24px, 7vw, 38px);
}

.winner-overlay-note {
  margin: 32px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.winner-dismiss {
  margin-top: 15px;
  padding: 12px 23px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.confetti {
  position: fixed;
  z-index: 110;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: confettiFall 2.2s linear forwards;
  pointer-events: none;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 205, 142, 0.58), transparent 24rem),
    linear-gradient(150deg, #fffaf5, #fff3e8);
}

.login-card {
  width: min(100%, 380px);
  padding: 29px 24px 24px;
  border: 1px solid rgba(232, 214, 199, 0.8);
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  width: 82px;
  height: 82px;
  margin-bottom: 12px;
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.9px;
}

.login-card > p {
  margin: 7px auto 21px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.login-card .field {
  text-align: left;
}

.login-card .btn {
  margin-top: 13px;
}

.install-login-button {
  width: 100%;
}

.login-footnote {
  display: block;
  margin-top: 16px;
  color: #9aa3a8;
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: 18px;
  right: 16px;
  left: 16px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(100%, 420px);
  padding: 12px 15px;
  color: white;
  border-radius: 13px;
  background: #2d3a42;
  box-shadow: 0 10px 25px rgba(33, 30, 28, 0.22);
  font-size: 11px;
  font-weight: 700;
  animation: toastIn 220ms ease both;
}

.toast.error {
  background: var(--danger);
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  background: var(--cream);
  font-size: 12px;
  font-weight: 700;
}

.loader {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 4px solid #f0ded2;
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
}

@keyframes ribbonIn {
  from { opacity: 0; transform: translateX(-120%) rotate(-6deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
}

@keyframes confettiFall {
  to { transform: translate3d(var(--drift), 105vh, 0) rotate(760deg); opacity: 0.85; }
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app-frame,
  .page,
  .login-screen {
    min-height: calc(100vh - 48px);
  }

  .spin-only-frame {
    min-height: calc(100vh - 48px);
  }

  .spin-only-frame .wheel-label {
    transform: rotate(var(--angle)) translateY(-130px) rotate(90deg);
  }

  .app-frame {
    border-radius: 32px;
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 32px 32px;
  }

  .modal-backdrop {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
