/* ============================================================
   tokens
   ============================================================ */
:root {
	/* palette pulled from the hokui thumbnails, muted down for daily use:
     golden ambient light -> bg, apron yellow -> minigame,
     strap green -> recruitment, sleeve/logo pink -> accent */
	--bg: #e9f3fa; /* pale pool water */
	--surface: #ffffff;
	--ink: #1e2c3f; /* logo outline navy */
	--ink-soft: #5a6b7e;
	--line: #d8e4ee;

	--accent: #2e7de0; /* hokui blue — primary action */
	--accent-grad: linear-gradient(135deg, #3aaee8, #2a7ae2); /* logo water -> ripple cyan, subtle */
	--accent-ink: #fffbf5;
	--accent-soft: #e6f0fb;

	--rec: #4fa53c; /* recruitment — palm green */
	--rec-soft: #e2f2dc;
	--mg: #e08a2e; /* minigame — orange slice */
	--mg-soft: #fbeed3;

	--danger: #b0483e;

	--radius: 14px;
	--radius-sm: 8px;

	--font-display: "Fredoka", "Instrument Sans", system-ui, sans-serif;
	--font-body: "Instrument Sans", system-ui, sans-serif;
}

/* ============================================================
   base
   ============================================================ */
* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.45;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
	padding: 0 24px 32px;
}

button {
	font: inherit;
	cursor: pointer;
}

/* ============================================================
   header
   ============================================================ */
.app-header {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 18px 24px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}
.brand-logo {
	height: 44px;
	display: block;
}
.brand-sub {
	font-family: "Fredoka", var(--font-body);
	font-size: 24px;
	font-weight: 500;
	color: var(--ink);
	letter-spacing: 0.01em;
}

.week-nav {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}
.week-label {
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 600;
	min-width: 190px;
	text-align: center;
}
.nav-btn {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	color: var(--ink-soft);
}
.nav-btn:hover {
	color: var(--ink);
	border-color: var(--ink-soft);
}

.auth-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	background: var(--ink);
	color: var(--surface);
	border: 1px solid var(--ink);
	border-radius: var(--radius-sm);
	font-weight: 500;
}
.auth-btn.signed-in {
	background: var(--surface);
	color: var(--ink);
	border-color: var(--line);
}

/* ============================================================
   week grid
   ============================================================ */
.week {
	display: grid;
	grid-template-columns: repeat(7, minmax(150px, 1fr));
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 8px;
}

.day {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 420px;
}
.day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.day-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 2px 4px 10px;
	border-bottom: 1px solid var(--line);
}
.day-name {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 15px;
}
.day-date {
	font-size: 12px;
	color: var(--ink-soft);
}
.today-dot {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--accent);
}

.slot-empty-note {
	padding: 18px 0;
	text-align: center;
	font-size: 13px;
	color: var(--ink-soft);
}

/* ============================================================
   slots
   ============================================================ */
.slot {
	border-radius: var(--radius-sm);
	min-height: 64px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.slot-claim {
	width: 100%;
	height: 100%;
	background: transparent;
	border: 1px dashed var(--line);
	border-radius: var(--radius-sm);
	color: var(--ink-soft);
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition:
		border-color 120ms,
		color 120ms,
		background 120ms;
}
.slot-claim:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-soft);
}

.slot-filled {
	background: var(--rec-soft);
	border: 1px solid var(--rec);
	padding: 8px 10px;
	gap: 3px;
	position: relative;
}
.slot-filled.type-minigame {
	background: var(--mg-soft);
	border-color: var(--mg);
}

.slot-time {
	font-weight: 600;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.slot-tz {
	font-weight: 400;
	font-size: 11px;
	color: var(--ink-soft);
}
.slot-host {
	font-size: 13px;
	color: var(--ink);
}
.slot-helpers {
	font-size: 12px;
	color: var(--ink-soft);
}

.badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 7px;
	border-radius: 99px;
	width: fit-content;
}
.badge-rec {
	background: var(--rec);
	color: var(--surface);
}
.badge-mg {
	background: var(--mg);
	color: var(--surface);
}

.slot-actions {
	position: absolute;
	top: 6px;
	right: 6px;
	display: none;
	gap: 4px;
}
.slot-filled.own:hover .slot-actions {
	display: flex;
}
.icon-btn {
	display: grid;
	place-items: center;
	padding: 0;
	line-height: 0;
	width: 24px;
	height: 24px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--ink-soft);
}
.icon-btn svg { display: block; }
.icon-btn:hover {
	color: var(--ink);
	border-color: var(--ink-soft);
}
.icon-btn.danger:hover {
	color: var(--danger);
	border-color: var(--danger);
}
.icon-btn.confirm {
	width: auto;
	padding: 0 8px;
	color: var(--danger);
	border-color: var(--danger);
	font-size: 11px;
	font-weight: 600;
}

/* ============================================================
   modal
   ============================================================ */
.modal-overlay[hidden] { display: none; } /* display:grid below would override the hidden attr otherwise */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 44, 63, 0.35);
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%; max-width: 380px;
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  margin: 0;
}
.modal-day { margin: 4px 0 20px; color: var(--ink-soft); font-size: 13px; }

.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.tz, .optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

.time-row { display: flex; gap: 8px; align-items: center; }
.time-row select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
}

.type-row { display: flex; gap: 8px; }
.type-pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 120ms;
}
.type-pill input:checked + .pill-rec { background: var(--rec-soft); border-color: var(--rec); color: var(--rec); }
.type-pill input:checked + .pill-mg  { background: var(--mg-soft);  border-color: var(--mg);  color: var(--mg); }
.type-pill input:focus-visible + .pill { outline: 2px solid var(--accent); outline-offset: 2px; }

.field input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
}
.field input[type="text"]:focus, .time-row select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* clock picker */
.clock-row { display: flex; align-items: center; gap: 18px; }
.clock {
  position: relative;
  width: 180px; height: 180px;
  flex: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.clock-num {
  position: absolute;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: none; border-radius: 50%;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  z-index: 1;
}
.clock-num:not(.sel):hover { color: var(--ink); background: var(--accent-soft); }
.clock-num.sel {
  color: var(--accent-ink);
  font-weight: 600;
}
.clock-disc {
  position: absolute;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-grad);
  transition:
    left 80ms cubic-bezier(0.34, 1.3, 0.64, 1),
    top 80ms cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
}
.clock-hand {
  position: absolute;
  left: 50%; bottom: 50%;
  width: 2px; height: 58px;
  background: var(--accent);
  transform-origin: bottom center;
  transform: translateX(-50%);
  border-radius: 2px;
  transition: transform 80ms cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
}
.clock-pivot {
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  margin: -4px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
}
.clock-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.clock-mode { display: flex; gap: 4px; }
.clock-mode button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 99px;
  padding: 3px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-soft);
}
.clock-mode button.sel {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
}

.clock-side { display: flex; flex-direction: column; gap: 12px; }
.ampm-row { display: flex; gap: 8px; }
.ampm-pill.sel {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-ink);
}
.clock-readout {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
}
.clock-local {
  font-size: 12px;
  color: var(--ink-soft);
}

/* chips input */
.chips-wrap { position: relative; }
.chips-input {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: text;
}
.chips-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.chips-input input {
  flex: 1; min-width: 120px;
  border: none; background: transparent;
  font: inherit;
  padding: 4px;
  outline: none;
}
.chips-input input:focus, .chips-input input[type="text"]:focus {
  outline: none;
  border-color: transparent;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 6px 3px 10px;
  font-size: 13px;
}
.chip-x {
  display: grid; place-items: center;
  width: 16px; height: 16px;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px; line-height: 1;
  padding: 0;
}
.chip-x:hover { color: var(--danger); }
.chips-suggest {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  z-index: 2;
}
.suggest-opt {
  display: block; width: 100%;
  padding: 8px 12px;
  border: none; background: transparent;
  text-align: left;
  font: inherit;
}
.suggest-opt:hover { background: var(--accent-soft); }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.btn { padding: 9px 18px; border-radius: var(--radius-sm); font-weight: 500; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-soft); }
.btn-solid { background: var(--accent-grad); border: 1px solid transparent; color: var(--accent-ink); }
.btn-solid:hover { filter: brightness(0.94); }

/* ============================================================
   toast + footer
   ============================================================ */
.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--ink);
	color: var(--surface);
	padding: 10px 18px;
	border-radius: var(--radius-sm);
	font-size: 13px;
}

.app-footer {
	display: flex;
	justify-content: space-between;
	padding: 14px 24px;
	font-size: 12px;
	color: var(--ink-soft);
	border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
	.app-header {
		flex-wrap: wrap;
		gap: 12px;
	}
	.week-nav {
		margin-left: 0;
		order: 3;
		width: 100%;
		justify-content: center;
	}
}
