/* Sanctuary Google Sign-In, Profile & Live Rewards Shared UI
   Matches Rescue Project Sage Daylight (data-appearance="light") and Dark Forest Green (data-appearance="dark").
   Enforces >=16px outer clearance between distinct buttons and >=12px inner frame clearance. */

.nav-account-button{
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 18px;
  border:1px solid var(--green);
  border-radius:999px;
  background:var(--paper-soft);
  color:var(--green);
  font:400 15px/1.4 var(--body);
  white-space:nowrap;
  transition:background .15s,color .15s,border-color .15s;
}
.nav-account-button:hover{
  background:var(--accent-soft);
}
.nav-account-button[data-signed-in="true"]{
  background:var(--green);
  border-color:var(--green);
  color:var(--button-ink);
}
.nav-account-button[data-signed-in="true"]:hover{
  background:var(--accent-hover);
}
.nav-account-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  border:2px solid currentColor;
  flex-shrink:0;
}
.nav-account-button[data-signed-in="true"] .nav-account-dot{
  background:currentColor;
}

#account-dialog{
  max-width:680px;
  width:min(680px,calc(100% - 40px));
  padding:28px;
}

.account-view-header{
  margin-bottom:20px;
}
.account-view-header h2{
  font-size:clamp(1.75rem,calc(1.4rem + 1vw),2.45rem);
  line-height:1.14;
  margin:12px 0 14px;
}
.account-view-header p{
  font-size:16px;
  line-height:1.75;
  margin:0;
  max-width:42em;
}

.account-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 13px;
  min-height:32px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--paper-soft);
  color:var(--green);
  font:400 11px/1.4 var(--body);
  letter-spacing:1.1px;
  text-transform:uppercase;
}
.account-pill-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--green);
  flex-shrink:0;
}
.account-pill[data-state="connected"]{
  background:var(--accent-soft);
  border-color:var(--green);
}

.account-gsi-panel{
  padding:22px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--paper-soft);
  margin:20px 0;
}
.account-gsi-label{
  display:block;
  font-size:12px;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--green);
  margin-bottom:14px;
}
.account-gsi-slot{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
}
.account-gsi-loading{
  font-size:14px;
  color:var(--muted);
}
.account-gsi-caption{
  font-size:13px;
  line-height:1.7;
  color:var(--muted);
  margin:14px 0 0;
}

.account-notice{
  padding:18px 20px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--paper-soft);
  margin:18px 0;
}
.account-notice strong{
  display:block;
  font:700 18px/1.3 var(--display);
  color:var(--ink);
  margin-bottom:6px;
}
.account-notice p{
  font-size:14px;
  line-height:1.75;
  margin:0;
  color:var(--muted);
}
.account-notice[data-tone="warning"]{
  background:#e5efe2;
  border-color:#9ab896;
}
.account-notice[data-tone="warning"] strong{
  color:#264531;
}
.account-notice[data-tone="warning"] p{
  color:#31523c;
}
.account-notice[data-tone="error"]{
  background:#e3ece9;
  border-color:#8aa9a1;
}
.account-notice[data-tone="error"] strong{
  color:#1f3d38;
}
.account-notice[data-tone="error"] p{
  color:#2b4c46;
}
body[data-appearance="dark"] .account-notice[data-tone="warning"]{
  background:#375247;
  border-color:#9ec2ae;
}
body[data-appearance="dark"] .account-notice[data-tone="warning"] strong{
  color:#eef5ec;
}
body[data-appearance="dark"] .account-notice[data-tone="warning"] p{
  color:#dbe9db;
}
body[data-appearance="dark"] .account-notice[data-tone="error"]{
  background:#2f483f;
  border-color:#8fb5a6;
}
body[data-appearance="dark"] .account-notice[data-tone="error"] strong{
  color:#eef5ec;
}
body[data-appearance="dark"] .account-notice[data-tone="error"] p{
  color:#d9e8e1;
}

.account-notice-actions{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  margin-top:16px;
}

.account-meta-bar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px 20px;
  padding:14px 18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper-soft);
  margin:18px 0;
  font-size:13px;
  color:var(--muted);
}
.account-player-code{
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
  color:var(--ink);
  word-break:break-all;
}

.sanctuary-summary-box{
  margin:20px 0;
}
.sanctuary-summary-heading{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:8px 16px;
  margin-bottom:14px;
}
.sanctuary-summary-heading h3{
  font-size:21px;
  margin:0;
}
.sanctuary-summary-heading span{
  font-size:12px;
  color:var(--muted);
}

.sanctuary-stats-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.sanctuary-stat-tile{
  padding:16px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--paper-soft);
  min-width:0;
}
.sanctuary-stat-tile span{
  display:block;
  font-size:11px;
  line-height:1.5;
  letter-spacing:.8px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:6px;
}
.sanctuary-stat-tile strong{
  display:block;
  font:700 clamp(1.3rem,calc(1.1rem + .5vw),1.65rem)/1.2 var(--display);
  color:var(--ink);
  overflow-wrap:anywhere;
}

.sanctuary-sync-note{
  font-size:12px;
  line-height:1.7;
  color:var(--muted);
  margin:12px 0 0;
}

.account-rewards-note{
  padding:16px 18px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:var(--paper-soft);
  font-size:13px;
  line-height:1.75;
  color:var(--muted);
  margin:18px 0 0;
}
.account-rewards-note strong{
  color:var(--ink);
  font-weight:400;
}

.account-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:16px;
  margin-top:22px;
}
.account-actions .button{
  margin:0;
}

/* Rewards page button stacks (>=16px between buttons) */
.account-card-actions,.bonus-card-actions{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.account-card-actions .button,.bonus-card-actions .button{
  width:100%;
  margin:0;
}
.game-account-card[data-live-account="connected"] .account-state-dot{
  background:var(--green);
}

/* Dedicated account.html page layout */
.account-page main{
  padding-bottom:48px;
}
.account-page nav a[aria-current="page"]{
  text-decoration:underline;
  text-underline-offset:7px;
  text-decoration-thickness:2px;
}
.account-hero{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(180px,.55fr);
  align-items:center;
  gap:32px;
  padding:clamp(24px,4vw,52px);
  border:1px solid var(--line);
  border-radius:30px;
  background:var(--paper);
  box-shadow:var(--shadow);
  margin-bottom:32px;
}
.account-hero h1{
  font-size:clamp(2.2rem,calc(1.55rem + 2.8vw),4.25rem);
  line-height:1.06;
  letter-spacing:-.9px;
  margin:0 0 20px;
  text-wrap:balance;
}
.account-hero h1 span{
  color:var(--green);
}
.account-hero-copy>p:not(.eyebrow){
  font-size:17px;
  line-height:1.8;
  max-width:38em;
  margin:0;
}
.account-hero-art{
  margin:0;
  text-align:center;
}
.account-hero-frame{
  max-width:230px;
  aspect-ratio:1;
  margin:0 auto;
  padding:16px;
  border-radius:45% 45% 22px 22px;
  border:1px solid var(--line);
  background:var(--paper-soft);
  display:grid;
  place-items:center;
}
.account-hero-frame img{
  width:100%;
  max-height:198px;
  object-fit:contain;
}
.account-hero-art figcaption{
  font-size:12px;
  color:var(--muted);
  margin-top:14px;
}

.account-layout{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(260px,.85fr);
  gap:28px;
  align-items:start;
  margin-bottom:44px;
}
.account-dashboard-card{
  min-width:0;
  padding:clamp(24px,3.5vw,44px);
  border:1px solid var(--line);
  border-radius:28px;
  background:var(--paper);
  box-shadow:var(--shadow);
}
.account-side-stack{
  display:grid;
  gap:24px;
  min-width:0;
}
.account-side-card{
  padding:clamp(22px,3vw,32px);
  border:1px solid var(--line);
  border-radius:24px;
  background:var(--paper);
  box-shadow:var(--shadow);
  min-width:0;
}
.account-side-card h2{
  font-size:clamp(1.45rem,calc(1.3rem + .4vw),1.85rem);
  line-height:1.2;
  margin:0 0 14px;
}
.account-side-card p{
  font-size:15px;
  line-height:1.78;
  margin:0 0 16px;
}
.account-side-card p:last-child{
  margin-bottom:0;
}
.account-side-list{
  margin:0;
  padding-left:18px;
  color:var(--muted);
  font-size:14px;
  line-height:1.8;
}
.account-side-list li+li{
  margin-top:10px;
}
.account-side-list strong{
  color:var(--ink);
  font-weight:400;
}
.account-side-actions{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  margin-top:20px;
}
.account-side-actions .button{
  width:100%;
  margin:0;
}

@media(max-width:1023px){
  .site-header nav .nav-account-button{
    width:100%;
    justify-content:center;
    padding:14px 18px;
    border-radius:12px;
  }
}

@media(max-width:860px){
  .account-layout{
    grid-template-columns:minmax(0,1fr);
  }
  .account-hero{
    grid-template-columns:minmax(0,1fr) minmax(140px,.45fr);
  }
}

@media(max-width:680px){
  .sanctuary-stats-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:639px){
  #account-dialog{
    width:calc(100% - 32px);
    padding:22px;
  }
  .account-hero{
    grid-template-columns:minmax(0,1fr);
    padding:24px;
    gap:22px;
  }
  .account-hero-frame{
    max-width:160px;
  }
  .account-dashboard-card,.account-side-card{
    padding:22px;
    border-radius:24px;
  }
  .account-gsi-panel{
    padding:18px;
  }
  .account-actions,.account-notice-actions{
    flex-direction:column;
    align-items:stretch;
    gap:16px;
  }
  .account-actions .button,.account-notice-actions .button{
    width:100%;
    justify-content:center;
  }
}

@media(max-width:380px){
  #account-dialog{
    padding:18px;
  }
  .sanctuary-stats-grid{
    grid-template-columns:minmax(0,1fr);
  }
}
