/* 컬러 팔레트
메인 배경   : #F4F1E8
카드 배경   : #FBF8F1
섹션 강조   : #CFE6E3
포인트 색상 : #E6C26E
*/

:root{
  --bg: #F4F1E8;
  --card: #FBF8F1;
  --section: #CFE6E3;
  --point: #E6C26E;
  --ink: #000;
}

body{
  margin:0;
  font-family:system-ui,"Noto Sans KR",sans-serif;
  background:var(--bg); /* 메인 배경 */
}

/* 기본 헤더(메인에서 쓰던 형태) */
header{
  position:relative;
  padding:40px 20px 20px;
  text-align:center;
}

h1{
  margin:0;
  font-size:28px;
  font-weight:800;
}

/* ===== 상단 우측 로그인/관리자 영역(공통) ===== */
.top-right{
  position:absolute;
  top:20px;
  right:20px;
  display:flex;
  gap:10px;
  align-items:center;
}

/* 상단 우측 버튼은 전역 button보다 우선 적용되도록 분리 */
.top-right button{
  border:3px solid var(--point);     /* 포인트 색상 */
  background:var(--card);            /* 카드 배경 톤과 통일 */
  padding:8px 16px;
  font-weight:800;
  cursor:pointer;
}

/* 로그아웃 강조(원하면 사용) */
.top-right .btn-logout{
  background:var(--point);
  color:var(--ink);
}

/* 전역 버튼(페이지 내부의 다른 버튼들도 이 톤을 쓰게) */
button{
  border:3px solid var(--point);
  background:var(--card);
  padding:8px 16px;
  font-weight:800;
  cursor:pointer;
}

main{
  display:flex;
  justify-content:center;
  gap:40px;
  margin-top:60px;
  flex-wrap:wrap;
  padding:0 20px 40px;
}

.card{
  width:220px;
  height:260px;
  background:var(--card);           /* 카드 배경 */
  border:5px solid var(--point);     /* 포인트 색상 */
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:800;
}

.user-label{
  font-weight:800;
}

/* 관리자 섹션 강조 */
.admin-panel{
  padding:20px;
  background:var(--section);          /* 섹션 강조 */
  border-top:6px solid var(--point);  /* 포인트 색상 */
}

.admin-title{
  margin:0 0 12px;
}

/* 로고 */
.logo{
  margin:0;
  display:flex;
  justify-content:center;
}

.logo img{
  height:250px;
  max-width:450%;
  object-fit:contain;
}

/* 모바일 대응 */
@media (max-width: 480px){
  .logo img{
    height:200px;
  }

  /* 상단 우측도 모바일에서 좀 더 컴팩트 */
  .top-right{
    top:12px;
    right:12px;
    gap:8px;
  }

  .top-right button{
    padding:6px 10px;
    font-size:13px;
  }
}

/* Page layout shared by sub pages */
.page-header{
  position:relative;
  padding:20px 20px 10px;
}

.page-title{
  text-align:center;
  font-weight:900;
  font-size:28px;
  margin:6px 0 0;
}

.back{
  position:absolute;
  left:20px;
  top:22px;
  text-decoration:none;
  color:var(--ink);
  font-weight:900;
}

.page-main{
  padding:20px 20px 40px;
  display:flex;
  justify-content:center;
}

.page-content{
  width:min(1100px, 100%);
}

.grid{
  width:min(1100px, 100%);
  display:grid;
  gap:18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 900px){
  .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px){
  .grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.troop-card{
  background:var(--card);
  border:5px solid var(--point);
  height:120px;
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  padding:18px;
  box-sizing:border-box;
  font-weight:900;
  text-decoration:none;
  color:var(--ink);
}

.troop-card:hover{
  outline:3px solid rgba(0,0,0,.15);
}

.add-card{
  background:var(--card);
  border:5px solid var(--point);
  height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:64px;
  font-weight:900;
  cursor:pointer;
  user-select:none;
}

/* Shared form + viewer utilities */
.wide{
  width:min(900px, 100%);
  height:auto;
  padding:18px;
}

.stack{
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:center;
}

.formRow{
  width:min(900px, 100%);
}

.form-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.form-title{
  font-weight:900;
  margin-bottom:10px;
}

.card-left{
  align-items:flex-start;
  justify-content:flex-start;
}

.w-full{
  width:100%;
}

.link{
  text-decoration:none;
  color:inherit;
}

textarea{
  width:100%;
  min-height:160px;
  border:3px solid var(--point);
  background:var(--card);
  padding:10px;
  font-weight:600;
}

input{
  width:100%;
  border:3px solid var(--point);
  background:var(--card);
  padding:10px;
  font-weight:800;
}

.viewer{
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:center;
  padding:0 20px 40px;
}

.viewer-text{
  font-family:system-ui,"Noto Sans KR",sans-serif;
  font-size:18px;
  line-height:1.6;
  white-space:pre-wrap;
}

.viewer-title{
  font-size:22px;
  font-weight:900;
}

/* Signup page overrides */
body.signup{
  background:#fff;
}

.signup header{
  padding:40px 20px 10px;
  text-align:center;
}

.signup h1{
  margin:0;
  font-size:26px;
  font-weight:900;
}

.signup main{
  display:flex;
  justify-content:center;
  padding:20px;
}

.signup .box{
  width:min(520px, 100%);
  border:5px solid #000;
  padding:18px;
  background:#fff;
}

.signup label{
  display:block;
  font-weight:900;
  margin-top:12px;
}

.signup input{
  width:100%;
  border:3px solid #000;
  padding:10px 12px;
  font-size:16px;
  background:#fff;
}

.signup button{
  margin-top:16px;
  border:3px solid #000;
  background:#fff;
  padding:10px 16px;
  font-weight:900;
  cursor:pointer;
}

.signup .row{
  display:flex;
  gap:12px;
  align-items:center;
}

.signup .avatar{
  width:64px;
  height:64px;
  border:3px solid #000;
  object-fit:cover;
}

.signup .muted{
  opacity:.75;
  font-size:13px;
  margin-top:10px;
}

.strong{
  font-weight:900;
}

.danger-btn{
  margin-left:auto;
  border:2px solid #d96a5a;
  background:#fff3f1;
  padding:8px 12px;
  font-weight:900;
  cursor:pointer;
}

/* ===== 전체 페이지 배경: background.png 1장 통으로 ===== */
html, body{
  min-height: 100%;
}

body{
  background-image: url("/img/background.png");
  background-repeat: no-repeat;   
  background-position: center top;
  background-size: cover;  /* 화면 꽉 채움(일부 잘릴 수 있음) */

  background-attachment: fixed;
  background-color: #f3eddc;
}
