/* Pokój ludzika-tamagotchi. Bazuje na style.css. */
.pet-page { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px 56px; align-items: start; padding-top: 16px; }
.pet-head { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; }
.pet-head h1 { margin: 0; }
.pet-lead { margin: 0; font-size: 18px; max-width: 36em; }

.room-wrap { position: relative; border: 2px solid var(--ink); border-radius: 10px 18px 12px 16px; overflow: hidden; background: var(--card); box-shadow: 6px 8px 0 var(--accent); }
.room { display: block; width: 100%; height: auto; }
.bubble {
  position: absolute; left: 50%; top: 14px; translate: -50% 0; max-width: min(78%, 420px); width: max-content; z-index: 2;
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 10px 16px;
  font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.3; text-align: center;
}
.bubble.pop { animation: bubble-pop .4s ease-out; }

/* elementy pokoju */
.room .wall { fill: #f7f7f5; }
.room .floor { fill: #ecebe7; }
.room .line, .room .frame, .room .frame-bar, .room .sill, .room .lamp, .room .table, .room .tv path, .room .chair, .room .mug, .room .steam, .room .pet { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.room .frame { fill: none; stroke-width: 5; }
.room .sill { stroke-width: 6; }
.room .shade { fill: #fff; }
.room .chair rect { fill: #e7ebf1; }
.room .tv-body { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.room .tv-screen { fill: #2b2f36; transition: fill .4s; }
.room .tv-play { fill: none; stroke: none; }
.room .mug path:first-child { fill: #fff; }
.room .steam { stroke: var(--muted); stroke-width: 2; opacity: 0; }
.room .pet { stroke: var(--accent); stroke-width: 3.6; }
.room .pet .head { fill: #fff; }
.room .glasses { stroke: #111214; stroke-width: 3.6; transition: transform .6s ease; }
.room .glasses rect { fill: rgba(255, 255, 255, .6); }
.room .m-grin { fill: #fff; }
.room .eyes-wide circle { fill: var(--accent); stroke: none; }
.room .zzz text { font-family: var(--serif); font-style: italic; font-size: 20px; fill: var(--accent); stroke: none; }
.room .night { fill: #0b1830; opacity: 0; pointer-events: none; transition: opacity 1s; }
.room .lamp-light { opacity: 0; transition: opacity .8s; }

/* niebo i pogoda w oknie */
.room .sky { fill: #dce8f4; transition: fill 1s; }
.room .w-city { fill: #c9d0da; }
.room .w-sun circle { fill: #ffd27a; }
.room .w-moon circle { fill: #f3efe0; }
.room .w-moon .moon-cut { fill: #0d1b33; }
.room .w-stars circle { fill: #fff; }
.room .w-clouds path { fill: #fff; opacity: .9; }
.room .w-fog rect { fill: #fff; opacity: .55; }
.room .w-rain path { stroke: #6b7a90; stroke-width: 1.6; stroke-linecap: round; fill: none; }
.room .w-snow circle { fill: #fff; }
.room .w-flash { fill: #fff; opacity: 0; }
.room .w-sun, .room .w-moon, .room .w-stars, .room .w-clouds, .room .w-fog, .room .w-rain, .room .w-snow { display: none; }

.t-dusk .sky { fill: #f2d9c4; }
.t-night .sky { fill: #0d1b33; }
.t-night .w-city { fill: #1d2c46; }
.t-day.w-clear .w-sun, .t-dusk.w-clear .w-sun { display: inline; }
.t-night.w-clear .w-moon, .t-night.w-clear .w-stars { display: inline; }
.w-partly .w-clouds, .w-cloudy .w-clouds, .w-rainy .w-clouds, .w-snowy .w-clouds, .w-storm .w-clouds { display: inline; }
.t-day.w-partly .w-sun { display: inline; }
.w-cloudy .sky, .w-rainy .sky, .w-storm .sky, .w-snowy .sky { fill: #c9d2de; }
.t-night.w-cloudy .sky, .t-night.w-rainy .sky, .t-night.w-storm .sky, .t-night.w-snowy .sky { fill: #182338; }
.t-night .w-clouds path { fill: #33415a; }
.w-fog .w-fog { display: inline; }
.w-rainy .w-rain, .w-storm .w-rain { display: inline; animation: rain .5s linear infinite; }
.w-snowy .w-snow { display: inline; animation: snow 4s linear infinite; }
.w-storm .w-flash { animation: flash 7s infinite; }
@keyframes rain { from { transform: translate(0, -50px); } to { transform: translate(-16px, 0); } }
@keyframes snow { from { transform: translate(0, -60px); } to { transform: translate(8px, 0); } }
@keyframes flash { 0%, 92%, 96%, 100% { opacity: 0; } 93%, 95% { opacity: .8; } }

/* noc: przygaszony pokój, lampa świeci, gdy ludzik nie śpi */
.t-night .night { opacity: .30; }
.t-night.asleep .night { opacity: .52; }
.t-night:not(.asleep) .lamp-light, .t-dusk:not(.asleep) .lamp-light { opacity: 1; }

/* pozy */
.room .arm-wave, .room .arm-mug, .room .eyes-closed, .room .eyes-wide, .room .eyes-tired, .room .m-grin, .room .m-flat, .room .m-frown, .room .m-o, .room .zzz { display: none; }
.room .eyes-open, .room .m-smile, .room .arm-rest { display: inline; }
.p-sen .eyes-open, .p-sen .m-smile { display: none; }
.p-sen .eyes-closed, .p-sen .m-o, .p-sen .zzz { display: inline; }
.p-sen .glasses { transform: translateY(-20px); }
.p-sen .pet-head { transform: rotate(-12deg); transform-origin: 360px 226px; transform-box: view-box; }
.p-sen .zzz text { animation: zzz 3s ease-in-out infinite; }
.p-sen .zzz text:nth-child(2) { animation-delay: .6s; } .p-sen .zzz text:nth-child(3) { animation-delay: 1.2s; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.p-trzesie .eyes-open, .p-trzesie .m-smile { display: none; }
.p-trzesie .eyes-wide, .p-trzesie .m-grin { display: inline; }
.p-trzesie .pet { animation: jitter .12s linear infinite; }
@keyframes jitter { 0% { transform: translate(0, 0); } 25% { transform: translate(1.5px, -1px); } 50% { transform: translate(-1px, 1px); } 75% { transform: translate(1px, 1.5px); } }
.p-zmeczony .eyes-open, .p-zmeczony .m-smile { display: none; }
.p-zmeczony .eyes-tired, .p-zmeczony .m-flat { display: inline; }
.p-zmeczony .pet-head { transform: translateY(4px) rotate(6deg); transform-origin: 360px 226px; transform-box: view-box; }
.p-smutny .m-smile { display: none; } .p-smutny .m-frown { display: inline; }
.p-wesoly .m-smile { display: none; } .p-wesoly .m-grin { display: inline; }
.p-wesoly .arm-rest { display: none; } .p-wesoly .arm-wave { display: inline; animation: wave .5s ease-in-out infinite alternate; transform-origin: 392px 232px; transform-box: view-box; }
@keyframes wave { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
.p-spokojny .arm-rest { display: inline; }
.p-film .m-smile { display: none; } .p-film .m-o { display: inline; }
.p-film .tv-screen { fill: #8fb3e0; animation: tv 1.4s steps(3) infinite; }
.p-film .tv-play { fill: #fff; }
@keyframes tv { 0% { fill: #8fb3e0; } 33% { fill: #c9a5d8; } 66% { fill: #a5d8c1; } }
.caf .steam { opacity: .8; animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 0% { transform: translateY(4px); opacity: 0; } 40% { opacity: .8; } 100% { transform: translateY(-8px); opacity: 0; } }

/* panel */
.pet-panel { display: flex; flex-direction: column; gap: 20px; }
.stats { display: flex; flex-direction: column; gap: 10px; }
.stat { display: grid; grid-template-columns: 84px 1fr 40px; align-items: center; gap: 12px; }
.stat span { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat b { font-variant-numeric: tabular-nums; color: var(--accent); text-align: right; }
.bar { height: 14px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s ease; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions button {
  min-height: 46px; padding: 0 18px; border: 2px solid var(--accent); border-radius: 999px; background: var(--card); color: var(--accent);
  font-family: var(--sans); font-weight: 900; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.actions button:hover { background: var(--accent); color: #fff; }
.actions button[disabled] { opacity: .5; cursor: wait; }
.actions button[hidden] { display: none; }
.pet-msg { margin: 0; min-height: 1.5em; font-style: italic; color: var(--muted); }
.pet-log { background: var(--card); border: 2px solid var(--ink); border-radius: 14px 6px 12px 8px; padding: 16px 20px; transform: rotate(-0.4deg); }
.pet-log h2, .pet-log h3 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pet-log ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.pet-log li span { color: var(--muted); }
.pet-log li.empty { color: var(--muted); font-style: italic; }
.pet-count { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.pet-page + .rules { margin-top: 96px; }

@media (max-width: 860px) {
  .pet-page { grid-template-columns: minmax(0, 1fr); }
  .bubble { font-size: 16px; top: 8px; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .room *, .bubble { animation: none !important; transition: none !important; }
}

/* Granite & Copper */
.pet-lead { color: var(--ink-2); }
.room-wrap { border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--paper); }
.bubble { border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); font-weight: 500; color: var(--ink); }
.room .wall { fill: #f7f8f9; }
.room .floor { fill: #e9ebed; }
.room .line, .room .frame, .room .frame-bar, .room .sill, .room .lamp, .room .table, .room .tv path, .room .chair, .room .mug, .room .steam { stroke: #101f27; }
.room .shade { fill: #faf1ea; }
.room .chair rect { fill: #dbe7ec; }
.room .tv-body { fill: #faf7f2; stroke: #101f27; }
.room .tv-screen { fill: #34424a; }
.room .pet { stroke: #234b5e; }
.room .pet .head { fill: #faf7f2; }
.room .glasses { stroke: #101f27; }
.room .eyes-wide circle { fill: #234b5e; }
.room .zzz text { fill: #7c3a22; font-family: var(--serif); }
.room .night { fill: #101f27; }
.room .sky { fill: #dbe7ec; }
.room .w-city { fill: #c3cfd6; }
.room .w-sun circle { fill: #e8a36f; }
.room .w-moon circle { fill: #f2ede4; }
.room .w-moon .moon-cut { fill: #101f27; }
.t-dusk .sky { fill: #f3ddd0; }
.t-night .sky { fill: #101f27; }
.t-night .w-city { fill: #22343f; }
.w-cloudy .sky, .w-rainy .sky, .w-storm .sky, .w-snowy .sky { fill: #c9d6dd; }
.t-night.w-cloudy .sky, .t-night.w-rainy .sky, .t-night.w-storm .sky, .t-night.w-snowy .sky { fill: #1b2c36; }
.t-night .w-clouds path { fill: #34424a; }
.room .w-rain path { stroke: #3c6d86; }
.p-film .tv-screen { fill: #3c6d86; animation: tv-gc 1.4s steps(3) infinite; }
@keyframes tv-gc { 0% { fill: #3c6d86; } 33% { fill: #a8502f; } 66% { fill: #4b7a5a; } }
.stat span { font-size: 12px; font-weight: 600; letter-spacing: .12em; color: var(--accent-deep); }
.stat b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 14px; }
.bar { height: 10px; border: 0; background: var(--steel-soft); }
.bar i { background: var(--accent); border-radius: 999px; }
.actions button { border: 1px solid var(--accent); color: var(--accent-deep); background: var(--card); font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; transition: background .2s var(--ease-soft), color .2s var(--ease-soft), transform .14s var(--ease-soft); }
.actions button:first-child { background: var(--accent); color: #fff; box-shadow: var(--shadow-copper); }
.actions button:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.pet-msg { color: var(--ink-2); }
.pet-log li span { font-family: var(--mono); font-size: 12px; }
.pet-log { border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transform: none; background: var(--card); }
.whisper { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.whisper button { min-height: 46px; padding: 0 20px; border: 1px solid var(--accent); border-radius: var(--radius-pill); background: var(--card); color: var(--accent-deep); font: 600 15px var(--sans); cursor: pointer; }
.secret-door { font-weight: 600; font-style: normal; color: var(--accent-deep); }
.room .pet-hit { fill: transparent; stroke: none; pointer-events: all; }
/* ciemny motyw: pokój zostaje ilustracją, panel ciemny */
.room-wrap { background: #f7f8f9; border-color: var(--rule); }
.bubble { background: #f4f5f7; color: #101f27; border-color: rgba(255, 255, 255, .6); }
.actions button { background: transparent; color: var(--accent-deep); border-color: var(--accent); }
.actions button:first-child { background: var(--accent); color: #fff; }
.actions button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.bar i { background: var(--accent); }
.whisper button { background: transparent; }
.bar i { background: linear-gradient(90deg, #e65b18, #ffa04d); }
.stat span { color: #f26a2e; }

/* ---------- surowy beton: twarde krawędzie, bez cieni; sam pokój zostaje rysunkiem ---------- */
.pet-head .mega { font-family: var(--sans); font-weight: 900; }
.room-wrap { border: var(--line) solid var(--ink); border-radius: 0; box-shadow: 8px 8px 0 var(--accent); background: #f7f8f9; }
.bubble { border: 2px solid #0b0b0a; border-radius: 0; box-shadow: none; background: #efeee9; color: #0b0b0a; font-family: var(--sans); font-style: normal; font-weight: 600; font-size: 16px; }
.room .zzz text { font-family: var(--sans); font-style: normal; font-weight: 900; }
.bar { border: var(--line) solid var(--ink); border-radius: 0; } .bar i { border-radius: 0; background: var(--accent); }
.actions button { border: var(--line) solid var(--ink); border-radius: 0; background: var(--card); color: var(--ink); font-weight: 800; font-size: 13px; letter-spacing: .04em; box-shadow: none; }
.actions button:first-child { background: var(--ink); color: var(--paper); box-shadow: none; }
.actions button:hover, .actions button:first-child:hover { background: var(--accent); border-color: var(--ink); color: #0b0b0a; }
.pet-log { border: var(--line) solid var(--ink); border-radius: 0; box-shadow: none; transform: none; }
.whisper button { border: var(--line) solid var(--ink); border-radius: 0; background: var(--card); color: var(--ink); font-weight: 700; box-shadow: none; }
.whisper button:hover { background: var(--accent); color: #0b0b0a; }
