:root{
  --bg: #ffffff;
  --surface: #f7f7f8;
  --text: #111;
  --muted: #666;
  --accent: #0b7cff;
  --card-border: rgba(17,17,17,0.08);
  --card-shadow: 0 6px 18px rgba(15,15,15,0.06);
  --glass: rgba(255,255,255,0.6);
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}
html,body,#root{height:100%}
body{
  margin:0;
  min-height:100vh;
  background:linear-gradient(180deg, var(--bg), #fbfbfb);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

/* Stage */
.stage{
  width:100%;
  max-width:980px;
  background:var(--surface);
  border-radius:14px;
  padding:20px;
  box-shadow: var(--card-shadow);
  border:1px solid rgba(12,12,12,0.03);
  transform-origin:center;
  animation:stage-entrance .55s cubic-bezier(.2,.9,.2,1);
}

/* Header */
.topbar{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:14px;
}
.topbar h1{
  margin:0;
  font-size:20px;
  font-weight:700;
  letter-spacing:0.2px;
}
.subtitle{
  margin:0;
  font-size:13px;
  color:var(--muted);
}

/* Grid layout: 2 columns x 2 rows */
.grid-wrap{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  grid-auto-rows:140px;
  gap:16px;
}

/* Card */
.card{
  background:linear-gradient(180deg, rgba(255,255,255,0.65), rgba(250,250,250,0.9));
  border-radius:10px;
  border:1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  transition:transform .22s cubic-bezier(.2,.9,.2,1), box-shadow .22s, border-color .22s;
  -webkit-tap-highlight-color: transparent;
  outline:none;
}

/* inner layout */
.card-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  pointer-events:none;
}
.card .icon{
  color:var(--accent);
  width:64px;
  height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .28s cubic-bezier(.2,.9,.2,1), opacity .22s;
}
.card svg{display:block; width:100%; height:100%;}
.card .label{
  font-weight:600;
  font-size:14px;
  color:var(--text);
}

/* Hover and focus */
.card:hover, .card:focus{
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(11,124,255,0.18);
  box-shadow: 0 10px 28px rgba(11,124,255,0.08);
}
.card:active{
  transform: translateY(-2px) scale(.995);
}

/* Ripple effect */
.card .ripple{
  position:absolute;
  left:0; top:0;
  width:100%; height:100%;
  pointer-events:none;
}

/* compact small screen adjustments */
@media (max-width:540px){
  .stage{ padding:14px; border-radius:10px;}
  .grid-wrap{ gap:12px; grid-auto-rows:120px;}
  .card{ padding:10px; border-radius:9px;}
  .card .icon{ width:52px; height:52px;}
}

/* entry & exit animations */
@keyframes stage-entrance{
  from{opacity:0; transform:translateY(10px) scale(.995)}
  to{opacity:1; transform:none}
}

/* per-card entrance stagger */
.card{ opacity:0; transform:translateY(10px) scale(.995); animation:cardIn .5s cubic-bezier(.2,.9,.2,1) forwards;}
.card:nth-child(1){ animation-delay:0.06s;}
.card:nth-child(2){ animation-delay:0.12s;}
.card:nth-child(3){ animation-delay:0.18s;}
.card:nth-child(4){ animation-delay:0.24s;}
@keyframes cardIn{
  to{opacity:1; transform:none;}
}

/* selected state animation — expands lightweight overlay */
.card--active{
  box-shadow: 0 18px 40px rgba(11,124,255,0.12);
  border-color: rgba(11,124,255,0.22);
  transform: translateY(-8px) scale(1.02);
}

/* subtle icon pulse when active */
.card--active .icon{ animation:iconPulse .64s ease both;}
@keyframes iconPulse{
  0%{ transform:scale(1); opacity:1;}
  50%{ transform:scale(1.18); opacity:1;}
  100%{ transform:scale(1); opacity:1;}
}

/* exit animation for removal (if we create an overlay) */
.card.exit{
  animation:cardExit .42s cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes cardExit{
  to{opacity:0; transform:translateY(6px) scale(.98)}
}

/* Footer */
.footer{ margin-top:16px; text-align:center; color:var(--muted); font-size:12px; }

/* accessible focus ring for keyboard users */
.card:focus-visible{
  box-shadow: 0 0 0 4px rgba(11,124,255,0.12);
}